News for hackers. Stuff that matters.
Re:Le Chat. Custom MCP Connectors. Memories by mark_l_watson on Thursday September 04, 2025 @07:55AM (#45126266)
It is such a common pattern for LLMs to surround generated JSON with ```json … ``` that I check for this at the application level and fix it. Ten years ago I would do the same sort of sanity checks on formatting when I used LSTMs to generate synthetic data.
Re:Le Chat. Custom MCP Connectors. Memories by Alifatisk on Thursday September 04, 2025 @08:25AM (#45126463)
I think this is the first time I stumped upon someone who actually mentions LSTM in a practical way instead of just theory. Cool!

Would you like to elaborate further on how the experience was with it? What was your approach for using it? How did you generate synthetic data? How did it perform?

Re:Le Chat. Custom MCP Connectors. Memories by p1esk on Thursday September 04, 2025 @10:21AM (#45127590)
10 years ago I used LSTMs for music generation. Worked pretty well for short MIDI snippets (30-60 seconds).
Re:Le Chat. Custom MCP Connectors. Memories by barrell on Thursday September 04, 2025 @08:27AM (#45126482)
Yeah, that’s infuriating. They’re getting better now with structured data, but it’s going to be a never ending battle getting reliable data structures from an LLM.

This is maybe more maybe less insidious. It will literally just insert a random character into the middle of a word.

I work with an app that supports 120+ languages though. I give the LLM translations, transliterations, grammar features etc and ask it to explain it in plain English. So it’s constantly switching between multiple real, and sometimes fake (transliterations) languages. I don’t think most users would experience this

Re:Le Chat. Custom MCP Connectors. Memories by Alifatisk on Thursday September 04, 2025 @08:28AM (#45126489)
I do use backticks a lot when sharing examples in different format when using LLMs and I have instructed them to do likewise, I also upvote whenever they respond in that matter.

I got this format from writing markdown files, it’s a nice way to share examples and also specify which format it is.

Re:Le Chat. Custom MCP Connectors. Memories by viridian on Thursday September 04, 2025 @08:40AM (#45126578)
I'm sure the reason is the plethora of markdown data is was trained on. I personally use ``` stuff.txt ``` extremely frequently, in a variety of places.

In slack/teams I do it with anything someone might copy and paste to ensure that the chat client doesn't do something horrendous like replace my ascii double quotes with the fancy unicode ones that cause syntax errors.

In readme files any example path, code, yaml, or json is wrapped in code quotes.

In my personal (text file) notes I also use ``` {} ``` to denote a code block I'd like to remember, just out of habit from the other two above.

Re:Le Chat. Custom MCP Connectors. Memories by accrual on Thursday September 04, 2025 @09:52AM (#45127290)
Same. For me it's almost like a symbiotic thing to me. After using LLMs for a couple of years I noticed I use code blocks/backticks a lot more often. It's helpful for me as an inline signal like "this is a function name or hostname or special keyword" but it's also helpful for other people/Teams/Slack and LLMs alike.
Re:Le Chat. Custom MCP Connectors. Memories by OJFord on Thursday September 04, 2025 @11:26AM (#45128349)
I'm the opposite, always been pretty good about doing that in Slack etc. (or even here where it doesn't affect the rendering) but I sometimes don't bother in LLM chat.
Re:Le Chat. Custom MCP Connectors. Memories by mejutoco on Thursday September 04, 2025 @10:00AM (#45127374)
Funny, I do the same. Additionally, one can define a json schema for the output and try to load the response as json or retry for a number of times. If it is not valid json or the schema is not followed we discard it and retry.

It also helps with having a field of the json be the confidence or a similar pattern to act as a cut for what response is accepted.

Re:Le Chat. Custom MCP Connectors. Memories by fumeux_fume on Thursday September 04, 2025 @10:45AM (#45127884)
Very common struggle, but a great way to prevent that is prefilling the assistant response with "{" or as much JSON output as you're going to know ahead of time like '{"response": ['
Re:Le Chat. Custom MCP Connectors. Memories by XenophileJKO on Thursday September 04, 2025 @11:47AM (#45128591)
Just to be clear for anyone reading this, the optimal way to do this is schema enforced inference. You can only get a parsable response. There are failure modes, but you don't have to mess with parsing at all.
Re:Le Chat. Custom MCP Connectors. Memories by psadri on Thursday September 04, 2025 @11:20AM (#45128284)
Haven’t tried this. Does it mix well with tool calls? Or does it force a response where you might have expected a tool call?
Re:Le Chat. Custom MCP Connectors. Memories by fumeux_fume on Thursday September 04, 2025 @12:30PM (#45129068)
It'll force a response that begins with an open bracket. So if you might need a response with a tool call that doesn't start with "{", then it might not fit your workflow.
Re:Le Chat. Custom MCP Connectors. Memories by freehorse on Thursday September 04, 2025 @10:46AM (#45127900)
I had similar issues with local models, ended up actually requesting the backticks because it was easier this way, and parsed the output accordingly. I cached a prompt with explicit examples how to structure data, and reused this over and over. I have found that without examples in the prompts some llms are very unreliable, but with caching some example prompts this becomes a non-issue.
Re:Le Chat. Custom MCP Connectors. Memories by tosh on Thursday September 04, 2025 @10:56AM (#45128015)
I think most mainstream APIs by now have a way for you to conform the generated answer to a schema.
Re:Le Chat. Custom MCP Connectors. Memories by mpartel on Thursday September 04, 2025 @10:58AM (#45128042)
Some LLM APIs let you give a schema or regex for the answer. I think it works because LLMs give a probability for every possible next token, and you can filter that list by what the schema/regex allows next.
Re:Le Chat. Custom MCP Connectors. Memories by hansvm on Thursday September 04, 2025 @11:03AM (#45128098)
Interestingly, that gives a different response distribution from simply regenerating while the output doesn't match the schema.
Re:Le Chat. Custom MCP Connectors. Memories by joshred on Thursday September 04, 2025 @02:04PM (#45130238)
It sounds like they are describing a regex filter being applied to the model's beam search. LLMs generate the most probable words, but they are frequently tracking several candidate phrases at a time and revising their combined probability. It lets them self correct if a high probability word leads to a low probability phrase.

I think they are saying that if highest probability phrase fails the regex, the LLM is able to substitute the next most likely candidate.

Re:Le Chat. Custom MCP Connectors. Memories by stavros on Thursday September 04, 2025 @05:59PM (#45132697)
You're actually applying a grammar to the token. If you're outputting, for example, JSON, you know what characters are valid next (because of the grammar), so you just filter out the tokens that don't fit the grammar.
Re:Le Chat. Custom MCP Connectors. Memories by joshred on Thursday September 18, 2025 @03:17PM (#45293801)
How do you get the alternate tokens?
Re:Le Chat. Custom MCP Connectors. Memories by Rudybega on Thursday September 04, 2025 @03:18PM (#45131168)
This is true, but there are methods to greatly reduce the effect of this and generate results that match or even improve overall output accuracy:

e.g. DOMINO https://arxiv.org/html/2403.06988v1