<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: andrii oliinyk</title>
    <description>The latest articles on DEV Community by andrii oliinyk (@andrii_oliinyk_1f2b44e25a).</description>
    <link>https://dev.to/andrii_oliinyk_1f2b44e25a</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3933921%2Ff6f8d5c8-2d8a-4f49-839e-61a672cf1abf.png</url>
      <title>DEV Community: andrii oliinyk</title>
      <link>https://dev.to/andrii_oliinyk_1f2b44e25a</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/andrii_oliinyk_1f2b44e25a"/>
    <language>en</language>
    <item>
      <title>Structured Outputs vs Free-Form Summaries: Notes from an AI Regulatory Monitoring Build</title>
      <dc:creator>andrii oliinyk</dc:creator>
      <pubDate>Fri, 15 May 2026 21:20:33 +0000</pubDate>
      <link>https://dev.to/andrii_oliinyk_1f2b44e25a/structured-outputs-vs-free-form-summaries-notes-from-an-ai-regulatory-monitoring-build-30lf</link>
      <guid>https://dev.to/andrii_oliinyk_1f2b44e25a/structured-outputs-vs-free-form-summaries-notes-from-an-ai-regulatory-monitoring-build-30lf</guid>
      <description>&lt;p&gt;Saw a case study from BN Digital on building an AI regulatory monitoring system and wanted to share the architectural takeaways, because they generalize beyond compliance to basically any LLM-in-production system.&lt;/p&gt;

&lt;h2&gt;
  
  
  The core problem
&lt;/h2&gt;

&lt;p&gt;LLMs are great at producing fluent text. Fluent text is terrible as a programmatic interface. If your downstream system is a human reviewer with a checklist, a database, or another service, free-form summaries are the wrong output shape.&lt;/p&gt;

&lt;h2&gt;
  
  
  Three design choices worth stealing
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Structured output schema instead of summaries&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Typed fields with constrained values. Same input → same output shape, every time. Diff-able across runs. Validates with a normal schema validator. Doesn't require a second LLM call to "parse" the first one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"regulation_id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"jurisdiction"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"change_type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"amendment | new | repeal"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"affected_entities"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"effective_date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"source_citation"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"..."&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Compare to "Here's a 4-paragraph summary of what changed" — same information, useless downstream.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Source filtering before the LLM step&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Most "hallucination" in domain-specific work is a garbage-in problem. The model isn't inventing — it's pattern-matching to irrelevant context you gave it. Classical retrieval/filtering before the generation step cuts the surface area dramatically.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Human-in-the-loop as part of the type system&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;High-stakes outputs get a &lt;code&gt;requires_review: true&lt;/code&gt; flag set by the model itself, with rules on what triggers it. Reviewer queue is a first-class part of the pipeline, not a thing bolted on after a compliance officer complains.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why this matters beyond RegTech
&lt;/h2&gt;

&lt;p&gt;The same pattern applies to any LLM system where outputs feed into other systems or workflows: medical decision support, financial analysis, legal drafting, infra automation. If your LLM output isn't typed, you're building a demo, not a system.&lt;/p&gt;

&lt;p&gt;Full case study: &lt;a href="https://bndigital.co/en-gb/cases/ai-regulatory-monitoring-system?utm_source=devto&amp;amp;utm_medium=backlink&amp;amp;utm_campaign=ai-reg" rel="noopener noreferrer"&gt;https://bndigital.co/en-gb/cases/ai-regulatory-monitoring-system?utm_source=devto&amp;amp;utm_medium=backlink&amp;amp;utm_campaign=ai-reg&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Curious if anyone here is using JSON schema enforcement (OpenAI structured outputs, Anthropic tool use, Outlines, etc.) in production and what's been brittle.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>architecture</category>
    </item>
  </channel>
</rss>
