frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Structured Outputs Create False Confidence

https://boundaryml.com/blog/structured-outputs-create-false-confidence
43•gmays•2h ago

Comments

dzrmb•2h ago
Interesting read and perspective. I had very good results with structured outputs, both text, images and tool calling. Also a lot of SDKs are using it, including Vercel AI SDK.

Thanks for sharing

swe_dima•1h ago
OpenAI structured outputs are pretty stable for me. Gemini sometimes responds with a completely different structure. Gemini 3 flash with grounding sometimes returns json inside ```json...``` causing parsing errors.
codegladiator•1h ago
https://github.com/josdejong/jsonrepair

might be useful ( i am not the author )

euazOn•51m ago
In case you're using OpenRouter, check out their new Response Healing feature that claims to solve exactly this issue.

https://openrouter.ai/announcements/response-healing-reduce-...

cmews•1h ago
Structured outputs work well depending on the tasks. The example mentioned in the blog post output doesn’t say anything because we are missing the prompt/schema definition. Also quantity is quite ambiguous because it could be bananas as a term is readable once on the receipt.

I would love some more detailed and reproducible examples, because the claims don’t make sense for all use cases I had.

mikert89•1h ago
please i cant take anymore anti ai hot takes.
swiftcoder•1h ago
How is this an "anti AI hot take"? It's discussing using one type of LLM output versus another...
emp17344•18m ago
Sounds like a you problem. I’m all for people investigating the boundaries of model capability - if you take that as a personal attack, you’re going to have a bad time over the next few years.
NitpickLawyer•1h ago
A 3rd alternative is to use the best of both worlds. Have the model respond in free-form. Then use that response + structured output APIs to ask it for json. More expensive, but better overall results. (and you can cross-check between your heuristic parsing vs. the structured output, and retry / alert on miss-matches)
machinationu•1h ago
or tell it to output the data at the end as markdown and then do a second pass with a cheaper model to build the structured output

also, xml works much better than json, all the model guides say this

dcastm•1h ago
While I agree that you must be careful when using structured outputs, the article doesn't provide good arguments:

1. In the examples provided, the author compares freeform CoT + JSON output vs. non-CoT structured output. This is unfair and biases the results towards what they wanted to show. These days, you don't need to include a "reasoning" field in the schema as mentioned in the article; you can just use thinking tokens (e.g., reasoning_effort for OpenAI models). You get the best of both worlds: freeform reasoning and structured output. I tested this, and the results were very similar for both.

2. Let Me Speak Freely? had several methodological issues. I address some of them (and .txt's rebuttal) here: https://dylancastillo.co/posts/say-what-you-mean-sometimes.h...

3. There's no silver bullet. Structured outputs might improve or worsen your results depending on the use case. What you really need to do is run your evals and make a decision based on the data.

pizzathyme•56m ago
The very first example, which is held up as an error, is actually arguably correct. If you asked a human (me) how many bananas were purchased, they clearly purchased one banana.

Yes the banana weighs 0.4 pounds. But the question was not to return the weight or the quantity, the question was to return the quantity.

It seems like more instructions are needed in the prompt that the author is not even aware of.

simonw•47m ago
I'm not 100% convinced by this post. I'd like to see a more extensive formal eval that demonstrates that structured outputs from different providers reduces the quality of data extraction results.

Assuming this holds up, I wonder if a good workaround for this problem - the problem that turning on structured outputs makes errors more likely - would be to do this:

1. Prompt the LLM "extract numbers from this receipt, return data in this JSON format: ..." - without using the structured output mechanism.

2. If the returned JSON does indeed fit the schema then great, you're finished! But if it doesn't...

3. Round-trip the response from the previous call through the LLM again, this time with structured outputs configured. This should give you back the higher quality extracted data in the exact format you want.

A_SIGINT•44m ago
> Chain-of-thought is crippled by structured outputs

I don't know if this is true. Libraries such as Pydantic AI and I would assume the model provider SDKs stream different events. If COT is needed then a <think> section would be emitted and then later the structured response would occur when the model begins its final response.

Structured outputs can be quite reliable if used correctly. For example, I designed an AST structure that allows me to reliably generate SQL. The model has tools to inspect data-points, view their value distributions (quartiles, medians, etc). Then once I get the AST structure back I can perform semantic validation easily (just walk the tree like a compiler). Once semantic validation passes (or forces a re-prompt with the error), I can just walk the tree again to generate SQL. This helps me reliably generate SQL where I know it won't fail during execution, and have a lot of control over what data-points are used together, and ensuring valid values are used for them.

I think the trick is just generating the right schema to model your problem, and understanding the depth of an answer that might come back.

noreplydev•43m ago
I don’t know if 0,42 should be the quantity
supermdguy•35m ago
If your output schema doesn’t capture all correct outputs, that’s a problem with your schema, not the LLM. A human using a data entry tool would run into the wrong issue. Letting the LLM output whatever it wants just makes it so you have to deal with ambiguities manually, instead of teaching the LLM what to do.

I usually start by adding an error type that will be overused by the LLM, and use that to gain visibility into the types of ambiguities that come up in real-world data. Then over time you can build a more correct schema and better prompts that help the LLM deal with ambiguities the way you want it to.

Also, a lot of the chain of thought issues are solved by using a reasoning model (which allows chain of thought that isn’t included in the output) or by using an agentic loop with a tool call to return output.

dhruvbird•21m ago
This ^^^^

While the provided schema has a "quantity" field, it doesn't mention the units.

<code>

class Item(BaseModel):

    name: str

    price: float = Field(description="per-unit item price")

    quantity: float = Field(default=1, description="If not specified, assume 1")

class Receipt(BaseModel):

    establishment_name: str

    date: str = Field(description="YYYY-MM-DD")

    total: float = Field(description="The total amount of the receipt")

    currency: str = Field(description="The currency used for everything on the receipt")

    items: list[Item] = Field(description="The items on the receipt")
</code>

There needs to be a better evaluation and a better provided schema that captures the full details of what is expected to be captured.

> What kind of error should it return if there's no total listed on the receipt? Should it even return an error or is it OK for it to return total = null?

Additionally, the schema allows optional fields, so the LLM is free to skip missing fields if they are specified as such.

Aurornis•35m ago
Does anyone have more benchmarks or evals with data on this topic? The claimed 20% accuracy reduction is significant.

Structured output was one of the lesser known topics that AI consultants and course writers got a lot of mileage out of because it felt like magic. A lot of management people would use ChatGPT but didn’t know how to bridge the text output into a familiar API format, so using a trick to turn it into JSON felt like the missing link. Now that I think about it, I don’t recall seeing any content actually evaluating the impact of constrained output on quality though.

This blog post blurs the lines between output quality reduction and incorrect error handling, though. I’d like to see some more thorough benchmarking that doesn’t try to include obvious schema issues in the quality reduction measurements.

rybosome•15m ago
I have heard this argument before, but never actually seen concrete evals.

The argument goes that because we are intentionally constraining the model - I believe OAI’s method is a soft max (I think, rusty on my ML math) to get tokens sorted by probability then taking the first that aligns with the current state machine - we get less creativity.

Maybe, but a one-off vibes example is hardly proof. I still use structured output regularly.

Oh, and tool calling is almost certainly implemented atop structured output. After all, it’s forcing the model to respond with a JSON schema representing the tool arguments. I struggle to believe that this is adequate for tool calling but inadequate for general purpose use.

Veen•8m ago
Doesn't the Claude APIs recently introduced ability to combine extended thinking with structured outputs overcome this issue? You get the unconstrained(ish) generation in the extended thinking blocks and then structured formatting informed by that thinking in the final output.
michaelgiba•3m ago
It’s not surprising that there could be a very slight quality drop off for making the model return its answer in a constrained way. You’re essentially forcing the model to express the actual answer it wants to express in a constrained language.

However I would say two things: 1. I doubt this quality drop couldn’t be mitigated by first letting the model answer in its regular language and then doing a second constrained step to convert that into structured outputs. 2. For the smaller models I have seen instances where the constrained sampling of structured outputs actually HELPS with output quality. If you can sufficiently encode information in the structure of the output it can help the model. It can effectively let you encode simple branching mechanisms to execute at sample time

throw-qqqqq•3m ago
Interesting! .TXT has the opposite conclusion, that structured output improves performance:

https://blog.dottxt.ai/say-what-you-mean.html

https://blog.dottxt.ai/prompt-efficiency.html

Reasons Not to Become Famous (2020)

https://tim.blog/2020/02/02/reasons-to-not-become-famous/
71•Tomte•2h ago•33 comments

ARIN Public Incident Report – 4.10 Misissuance Error

https://www.arin.net/announcements/20251212/
77•immibis•1h ago•13 comments

Show HN: Books mentioned on Hacker News in 2025

https://hackernews-readings-613604506318.us-west1.run.app
17•seinvak•55m ago•3 comments

Show HN: WalletWallet – create Apple passes from anything

https://walletwallet.alen.ro/
58•alentodorov•1h ago•20 comments

E.W.Dijkstra Archive

https://www.cs.utexas.edu/~EWD/welcome.html
33•surprisetalk•1h ago•1 comments

Structured Outputs Create False Confidence

https://boundaryml.com/blog/structured-outputs-create-false-confidence
43•gmays•2h ago•22 comments

ELF Crimes: Program Interpreter Fun

https://nytpu.com/gemlog/2025-12-21
12•nytpu•46m ago•2 comments

Coarse Is Better

https://borretti.me/article/coarse-is-better
104•_dain_•4h ago•55 comments

Show HN: Jmail – Google Suite for Epstein files

https://www.jmail.world
1189•lukeigel•20h ago•258 comments

Three Ways to Solve Problems

https://andreasfragner.com/writing/three-ways-to-solve-problems
43•42point2•2h ago•7 comments

I Program on the Subway

https://www.scd31.com/posts/programming-on-the-subway
11•evankhoury•4d ago•5 comments

Backing up Spotify

https://annas-archive.li/blog/backing-up-spotify.html
1569•vitplister•22h ago•527 comments

Ruby website redesigned

https://www.ruby-lang.org/en/
242•psxuaw•10h ago•87 comments

Indoor tanning makes youthful skin much older on a genetic level

https://www.ucsf.edu/news/2025/12/431206/indoor-tanning-makes-youthful-skin-much-older-genetic-level
151•SanjayMehta•11h ago•99 comments

Show HN: Shittp – Volatile Dotfiles over SSH

https://github.com/FOBshippingpoint/shittp
84•sdovan1•4h ago•49 comments

What I Learned About Deploying AV1 from Two Deployers

https://streaminglearningcenter.com/articles/what-i-learned-about-deploying-av1-from-two-deployer...
14•breve•5d ago•8 comments

Measuring AI Ability to Complete Long Tasks

https://metr.org/blog/2025-03-19-measuring-ai-ability-to-complete-long-tasks/
193•spicypete•13h ago•143 comments

Decompiling the New C# 14 field Keyword

https://blog.ivankahl.com/decompiling-the-new-csharp-14-field-keyword/
45•ivankahl•4d ago•15 comments

Show HN: The Official National Train Map Sucked, So I Made My Own

https://www.bdzmap.com/
33•Pavlinbg•5h ago•6 comments

Show HN: RenderCV – Open-source CV/resume generator, YAML → PDF

https://github.com/rendercv/rendercv
17•sinaatalay•4h ago•10 comments

The uncertain origins of aspirin

https://www.asimov.press/p/aspirin
46•dearwell•4d ago•10 comments

Go ahead, self-host Postgres

https://pierce.dev/notes/go-ahead-self-host-postgres#user-content-fn-1
612•pavel_lishin•1d ago•366 comments

Claude in Chrome

https://claude.com/chrome
259•ianrahman•19h ago•142 comments

Ireland’s Diarmuid Early wins world Microsoft Excel title

https://www.bbc.com/news/articles/cj4qzgvxxgvo
279•1659447091•21h ago•93 comments

Log level 'error' should mean that something needs to be fixed

https://utcc.utoronto.ca/~cks/space/blog/programming/ErrorsShouldRequireFixing
443•todsacerdoti•4d ago•274 comments

Isengard in Oxford

https://lareviewofbooks.org/article/isengard-in-oxford/
93•lermontov•11h ago•11 comments

Pure Silicon Demo Coding: No CPU, No Memory, Just 4k Gates

https://www.a1k0n.net/2025/12/19/tiny-tapeout-demo.html
393•a1k0n•1d ago•61 comments

Inca Stone Masonry

https://www.earthasweknowit.com/pages/inca_construction
111•jppope•9h ago•32 comments

OpenSCAD is kinda neat

https://nuxx.net/blog/2025/12/20/openscad-is-kinda-neat/
295•c0nsumer•23h ago•225 comments

DNS4EU Blocks Blog.fefe.de

10•koehr•1h ago•4 comments