Post

Smaller models forget system prompt instructions. What if we attach instructions to specific tools and deliver them the moment the model tries to use them? I call this guidance injection. samihonkonen.com/posts/guidan...

samihonkonen.comGuidance injection: reliable instructions for local LLMsSystem prompts don’t work reliably for smaller models. Guidance injection delivers instructions at the exact moment they’re needed instead.

0 reposts10 likes

this is super cool! It definitely reminds me of deferred tools, but for a model without specific training for it. It also sounds like it can be implemented inference side, to prevent needing a round trip as well. I really like the ack as well

I think that using this to keep the system prompt small could lead to the model ignoring the guidance in tool call output due to the instruction hierarchy and anti-jailbreak. Deferred tools schemas are appended as system/developer messages iirc

Interesting! I hadn't thought about instruction hierarchy and so far haven't seen this come up. Maybe it's because I have generic tool use instructions in the system prompt and the injected guidance makes it more specific. Maybe the mentions in the system prompt lend credence to the tool outputs?

The extra round trip is annoying, but significantly less so than having to tell the model afterwards to read the instructions and fix the mess it made :D

Guidance injection at inference would be awesome. However, the guidance my app injects is user-editable at runtime. I think we'd lose that if this was inference side?

it should definitely be possible! deferred tools work like this inference side too to prevent round trips. As long as you know the tool->guidance mapping at api request time (chat completions, responses api, etc), you can just send both to inference and inference can manage the guidance flow

Mostly I just think this is cool and these patterns are useful at all layers of the model serving stack, and messing with the inference layer makes things fun :)