Structured Outputs
Structured outputs involve prompting | LLMs to return responses | in specific formats like
Structured outputs liên quan đến việc yêu cầu | các LLMs trả về phản hồi | theo các định dạng cụ thể như
JSON, XML, or other | organized structures rather than | free-form text.
JSON, XML hoặc các | cấu trúc có tổ chức khác thay vì | văn bản tự do.
This approach forces models | to organize information systematically, | reduces hallucinations by imposing
Cách tiếp cận này buộc các mô hình | phải tổ chức thông tin một cách hệ thống, | giảm bớt các ảo tưởng bằng cách áp đặt
format constraints, enables easy | programmatic processing, and facilitates | integration with applications.
các ràng buộc định dạng, cho phép | xử lý theo chương trình dễ dàng, và tạo điều kiện | tích hợp với các ứng dụng.
For example, requesting movie | classification results as JSON | with specified schema ensures
Ví dụ, yêu cầu kết quả | phân loại phim dưới dạng JSON | với schema được chỉ định đảm bảo
consistent, parseable responses. | Structured outputs are particularly | valuable for data extraction,
các phản hồi nhất quán, có thể phân tích. | Structured outputs đặc biệt | có giá trị cho việc trích xuất dữ liệu,
API integration, and applications | requiring reliable data formatting.
tích hợp API, và các ứng dụng | yêu cầu định dạng dữ liệu đáng tin cậy.
Resources
- Diving Deeper with Structured Outputs (article)
- Structured model outputs - OpenAI (article)
- Structured outputs - Claude (article)
- How to Measure LLM Confidence: Logprobs & Structured Output (video)