Forcing the output into shape: grammars and schemas
Forcing a model to produce valid JSON is easy. Noticing that the forcing also changes the model's distribution is hard.
4 steps
225 XP
A free account is needed
Start the lesson →
Sources
- Willard, B. T. & Louf, R. 2023 · Efficient Guided Generation for Large Language Models · arXiv:2307.09702
- Geng, S. et al. 2023 · Grammar-Constrained Decoding for Structured NLP Tasks without Finetuning · EMNLP 2023
- Park, K. et al. 2024 · Grammar-Aligned Decoding · NeurIPS 2024
- Tam, Z. R. et al. 2024 · Let Me Speak Freely? A Study on the Impact of Format Restrictions on Performance of Large Language Models · EMNLP 2024 Industry
ML Academy · an interactive machine learning course that runs in your browser ·
All lessons