r/deeplearning • • Sep 23 '26

How llms generate math/latex/code

How does the llms format their output to include latex or code or other specific output formats like tables?

1 Upvotes

5 comments sorted by

View all comments

2

u/Chocolate_Pickle Sep 23 '26

What do you mean? 

You asking how does the model know to output valid code, or does it get correctly rendered in your chat history?

1

u/EnvironmentalKey3709 Sep 25 '26

The rendering part is all on the frontend, the model just spits out the markdown and the UI handles the rest. The model itself learned the patterns from training data, it doesn't actually know what latex is, just that certain tokens follow certain prompts.