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

Subscribers:
5,330
Published on ● Video Link: https://www.youtube.com/watch?v=A6sIh-lmApk



Duration: 28:30
861 views
19


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

This should be incorporated into SymbolicAI shortly too!

~~~~~~~~~~~~~~~~~~~~~~

Github Repo Link: https://github.com/tanchongmin/strictjson

~~~~~~~~~~~~~~~~~~~~~~

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.

Discord: https://discord.gg/bzp87AHJy5
LinkedIn: https://www.linkedin.com/in/chong-min-tan-94652288/
Online AI blog: https://delvingintotech.wordpress.com/
Twitter: https://twitter.com/johntanchongmin
Try out my games here: https://simmer.io/@chongmin




Other Videos By John Tan Chong Min


2023-08-17Tutorial #8: Create a Web Scraper using ChatGPT and Selenium!
2023-08-17Tutorial #7: Create a Chatbot with Gradio and ChatGPT!
2023-08-15LLMs as General Pattern Machines: Use Arbitrary Tokens to Pattern Match?
2023-08-08Tutorial #6: LangChain & StrictJSON Implementation of Knowledge Graph Question Answer with LLMs
2023-08-08Large Language Models and Knowledge Graphs: Merging Flexibility and Structure
2023-07-31Tutorial #5: SymbolicAI - Automatic Retrieval Augmented Generation, Multimodal Inputs, User Packages
2023-07-27How Llama 2 works: Ghost Attention, Quality Supervised Fine-tuning, RLHF for Safety and Helpfulness
2023-07-27Llama 2 vs ChatGPT
2023-07-11I-JEPA: Importance of Predicting in Latent Space
2023-07-09Gen AI Study Group Introductory Tutorial - Transformers, ChatGPT, Prompt Engineering, Projects
2023-07-03Tutorial #5: Strict JSON LLM Framework - Get LLM to output JSON exactly the way you want it!
2023-07-01Tutorial #4: SymbolicAI ChatBot In-Depth Demonstration (Tool Use and Iterative Processing)
2023-06-29How do we learn so fast? Towards a biologically plausible model for one-shot learning.
2023-06-20LLMs as a system to solve the Abstraction and Reasoning Corpus (ARC) Challenge!
2023-06-16Tutorial #3: Symbolic AI - Symbols, Operations, Expressions, LLM-based functions!
2023-06-13No more RL needed! LLMs for high-level planning: Voyager + Ghost In the Minecraft
2023-06-06Voyager - An LLM-based curriculum generator, actor and critic, with skill reuse in Minecraft!
2023-06-01Evolution ChatGPT Prompt Game - From Bacteria to.... Jellyfish???
2023-05-30Prompt Engineering and LLMOps: Tips and Tricks
2023-05-25Hierarchy! The future of AI: How it helps representations and why it is important.
2023-05-18Prediction builds representations! Fixed Bias speeds up learning!