I just discovered another area where AI falls shor...
# random
s
I just discovered another area where AI falls short: sometimes, it simply doesn't seem to know the specs. While working on a new
TiffWriter
for Kim, DeepSeek V4 Pro introduced 4-byte alignment for TIFF offsets. I noticed because my reference images suddenly changed. When I asked why, it confidently told me that this was required by the TIFF specification. A quick check with ChatGPT showed that the TIFF specification actually requires offsets to be word-aligned, meaning they must be even. In other words, padding is only needed to ensure 2-byte alignment, not 4-byte alignment. Sometimes I genuinely wonder why these models aren't trained directly on official specifications and RFCs. πŸ€·β€β™‚οΈ
Maybe that's a training issue that Claude Opus wouldn't have. Or perhaps it's a general issue. I don't know. I can't recall encountering a situation like that with Opus, but I use Opus quite sparingly because it's so expensive.
ChatGPT says the issue is that the model doesn't inherently know which source has normative authority. Couldn't this be pinned?
r
They probably are trained on specs and RFCs, but that doesn't mean they'll get it right?
s
I have not enough insight to judge about that. I'd expect if they get specs and RFCs with a weight/emphasis on "this is a trusted source" it should work. On the other hand I also see Claude Sonnet & others agents (sometimes even Opus) ignoring the rules in my AGENTS.md. πŸ€·β€β™‚οΈ
r
I tink you trust LLMs far more than you should
πŸ’― 5
s
AIs have this randomness and I feel I can't trust them. Even if they get it 9 times right, the 10th time might be a desaster.
I tink you trust LLMs far more than you should
A bit, maybe. After seeing Opus and also DeepSeek V4 Flash doing well on a few tasks in a row I start to build up trust... which is then destroyed again. πŸ˜…
m
I have a simple trick for that. Tell the AI to read the spec before starting to code anything. That helps πŸ§πŸ˜‡.
πŸ˜… 2
r
You can also just upload the spec/article/whatever as part of your prompt
s
Of course. But usually, you would expect a coding agent to be trained on standard specifications like TIFF. I don't attach the Kotlin spec to my prompts either.
But maybe I should write all links to specs about image formats to the AGENTS or README... Which still wouldn't be a guarantee it'll follow the docs, right?
r
Of course. But usually, you would expect a coding agent to be trained on standard specifications like TIFF
And it is, but I bet there's a lot less training data on TIFF vs Kotlin out there πŸ™‚
s
Certainly. My point is that everything important is in a RFC and rfc-editor.org is a trusted source for that. Why can't I expect AI to be trained on that and know about it?
r
I would be shocked if it wasn't. But because it saw the RFC during training doesn't mean the way an LLM works will let it reason about that specific RFC properly
Heck, I've seen those models fuck up implementing basic integrals, and they've certainly been trained on many integrals πŸ˜„
πŸ˜„ 1
s
Certainly. Sometimes they create algorithms I don't have the math skills for and the next moment they produce garbage like this right now.
r
The problem is that maybe those algorithms have similar garbage inside and you just can't tell
s
I'm not with Uncle Bob here. AI code needs to be reviewed. But he's right that introducing tight detekt rules into my project helped a lot to make the code more readable. And unit tests tell the AI & me if it breaks something. x.com/unclebobmartin/status/2044114698451476492
r
Don't be with Uncle Bob on pretty much anything πŸ˜„
s
The problem is that maybe those algorithms have similar garbage inside and you just can't tell
That's what I fear. πŸ‘€ But in the past I took those from Stackoverflow and this wasn't much better. πŸ˜… I just can add unit tests to make sure that the result is correct, if I can't understand the vector matrix multiplication with sinus & cosinus πŸ˜„
r
Yeah tests and validation loops are definitely necessary, but sometime not understanding the edge case or really the problem fully can mean the right tests are missing
true 1
s
Don't be with Uncle Bob on pretty much anything πŸ˜„
Clean Code is gold standard to me. I'm with everything, BUT that AI statement.
r
I have… thoughts about Clean Code, at least the examples from the book. Lot of garbage in there. The core principles are good (except when taken like gospel)
s
But AI can be really hard-working ... today I added full MakerNote support to Kim. That included 300+ tags from different vendors. Going through the ExifTool docs and adding all of that would have cost me weeks of work. DeepSeek was able to do it in a few hours for $5.
r
Don't be so harsh on those AIs. Do you understand everything after reading the specifications just once? πŸ˜‚
πŸ˜„ 3
πŸ™‚ 1
πŸ˜‚ 1
h
I haven't tested this, but some people I work with say it works: context7.com
πŸ‘ 1
j
I use Context7, because without it Claude will not stop extracting jars/aars from local Cradle cache to then read everything and figure out the API πŸ₯²
πŸ‘€ 1
a
I must say that I have very good experiences with LLMs referring to specs. I would never trust the LLM with implementing from an rfc it was trained on. But providing a knowledgable model with access to an rfc via proper tools works pretty good. And… tests and having proper validation tools and introspection tools in place that the AI can refer to. A sidenote: i dont think models should even be trained on rfcs. They should understand structure of RFC, but that is trivial. Content this specific should be context, either via clever MCP/tools, or just via MD files in a repo (and as such a tool again). There are a lot of MCPs that allow your coding agent to search large bodies of content and 'understand' structure, backlinks, references, etc. Actual use-case from my work. We handle a complex proces of artist and publishers registering musical works which contains some complex policy rules based lots of articles of association. This was made in 2017 in very bad PHP. It was working but we were already a few year thinking of porting it to proper Kotlin but no time. Luckily for us we had millions of kafka messages where the final work XML was send and we had the database tables with all our historical works. We converted the 120 pages of policy rules in structured markdown, and set Fable to work (following our project guidelines on services, interfaces etc) to implement exactly the same HTTP API and after a day's work it had 1:1 exact same XML results of millions of works, including good test sets AND readably code with a proper Policy Engine referring to the exact clauses. After business validation we found 0 defects. Besides that, it even found some wrongly interpreted policies (and as such the 1:1 match was off in the beginning) in the legacy code that nobody had found but some support tickets complained about. No LLM was trained on those policy rules, but it is just proper context management.
πŸ‘ 1