TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

StructuredRAG: JSON Response Formatting with Large Language Models

38 pointsby bobvanluijt10 months ago

2 comments

FlyingLawnmower10 months ago
Interesting paper, but their reason for dismissing constrained decoding methods seems to be that they want to academically study the in-context setting.<p>For practitioners, using a framework like Guidance which forces the models to write valid JSON as they generate text solves this trivially (<a href="https:&#x2F;&#x2F;github.com&#x2F;guidance-ai&#x2F;guidance">https:&#x2F;&#x2F;github.com&#x2F;guidance-ai&#x2F;guidance</a>)<p>For json in particular these frameworks have functions that take in json schemas or pydantic schemas <a href="https:&#x2F;&#x2F;guidance.readthedocs.io&#x2F;en&#x2F;latest&#x2F;generated&#x2F;guidance.json.html#guidance-json" rel="nofollow">https:&#x2F;&#x2F;guidance.readthedocs.io&#x2F;en&#x2F;latest&#x2F;generated&#x2F;guidance...</a>
评论 #41326096 未加载
评论 #41328157 未加载
l5870uoo9y10 months ago
&gt; It may additionally be promising to test Chain-of-Thought (CoT) prompting strategies. This entails adding a “rationale” key to the model’s output such that the additional reasoning improves the performance of the model. However, this will require the output to be a composite object with the additional &quot;rationale&quot; key and string-valued response. Our results suggest that this additional output structure may result in lower success rates. Similar in spirit to structured decoding methods, it may also be helpful to prefix the end of the prompt with “{“ or use the key, such as “{“paraphrased_questions”: [&quot;.<p>For most of my prompts I want CoT.