filmov
tv
Tutorial #5: Strict JSON LLM Framework - Get LLM to output JSON exactly the way you want it!

Показать описание
I'm creating a framework that can generate the output of an LLM as a JSON, and ensures that all output fields are generated. This is done using iterative prompting of the error messages to the LLM should the LLM generate the output incorrectly.
Features:
- Free-text generation for output fields
- Constrained generation from one element of the list
- Constrained generation of the label from "label:description" elements of a list
- Flexible header/value generation using angle brackets
- Chain of thought prompting by ordering the output fields of the JSON
- Multiple input processing using a list as input and outputting a list of JSON
Future work:
- LLM + Rules-based Adaptive Functions
Dynamic Tool Use
Agents with Tool Use
~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~
0:00 Introduction
1:48 Overall Open-ended Generation
3:35 List-based constraining of output
6:06 List-based label constraining of ouput
8:06 Dynamic output format with angle brackets
10:18 Chain-of-thought prompting via JSON
15:05 List Input for Multiple Processing
18:55 The Magic Revealed: How it works
~~~~~~~~~~~~~~~~~~~~~~~
AI and ML enthusiast. Likes to think about the essences behind breakthroughs of AI and explain it in a simple and relatable way. Also, I am an avid game creator.
Features:
- Free-text generation for output fields
- Constrained generation from one element of the list
- Constrained generation of the label from "label:description" elements of a list
- Flexible header/value generation using angle brackets
- Chain of thought prompting by ordering the output fields of the JSON
- Multiple input processing using a list as input and outputting a list of JSON
Future work:
- LLM + Rules-based Adaptive Functions
Dynamic Tool Use
Agents with Tool Use
~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~
0:00 Introduction
1:48 Overall Open-ended Generation
3:35 List-based constraining of output
6:06 List-based label constraining of ouput
8:06 Dynamic output format with angle brackets
10:18 Chain-of-thought prompting via JSON
15:05 List Input for Multiple Processing
18:55 The Magic Revealed: How it works
~~~~~~~~~~~~~~~~~~~~~~~
AI and ML enthusiast. Likes to think about the essences behind breakthroughs of AI and explain it in a simple and relatable way. Also, I am an avid game creator.
Комментарии