ive been thinking about llm's struggle to stay consistent and follow nuanced instructions over time due to swiss cheese memory degradation over sequences of steps / prompts... the solution in my mind is harness-driven... which i think is a mainstream thought at this point... though current solutions are still shallow and primitive... we need something more granular, precise, semantic, targeted, efficient, and reliable... i think there are two dimensions to this... semantic alignment and structural / mechanical adherence... for semantic alignment its hard to write deterministic tests to validate conformance post-hoc... semantics seems only somewhat verifiable via ml / ai and even then the lack of 100% yay or nay is problematic at scale or on critical work...
meaning the best way to keep the llm on track is injecting semantic rules / guidance via the harness during context assembly... the harness parses files into an ast under the hood to deterministically locate target nodes and run checks, while still feeding the llm the normal raw text file we are used to digesting... say i prompt my harness to modify some function... that target node sits inside nested scopes (project, directory, file, content-node) plus orthogonal scopes like file-kind and node-kind that cut across those altitudes... we can inject rules into the raw text reflecting that scope hierarchy... function naming rules go right next to the target function, file rules near the top of the file, project rules just above that etc... though writing this i realize this works for existing code, while new yet-to-exist content still has holes to solve... hmmm... anyway thats a rough outline to minimize semantic drift efficiently and deterministically, even if output verification still lacks a deterministic silver bullet...
the second dimension is structural / mechanical / syntactic conformance... this half can be leaned on and trusted much more because structure and mechanics can be deterministically measured... we run output pre-application through our own parser / linter embodying our rules... for basic syntax this is probably overkill since models rarely output malformed syntax anymore... valid syntax is a shared cultural agreement beyond any single app... the real value of pre-application verification is enforcing opinionated structure... like minimizing cyclomatic complexity or forcing function identifiers to match a strict grammar... if a check fails our threshold, the harness rejects the output before application and forces the llm to iterate until it passes... and with our scoped architecture we can attach these checks at any granular level...
there are definitely blindspots in my thoughts above... though the core problem is hard to refute... everyone using llms with standard harnesses hits this, especially nuanced semantic drift... syntax gets trained in because communities agree on it, whereas our opinions are what partition us into unique problem solvers... by its very nature, general-purpose llm output cant be relied on unchecked... we have to stay on top of every input and output to bound variance... regardless of whether you agree with my specifics, harnesses need to become pluggable platforms with tailored context assembly and output verification as first-class user-configurable features... this post is less about my specific semantic or mechanical mechanisms and more about keeping llm output contained within acceptable deviation as defined by its pilot...
Comments URL: https://news.ycombinator.com/item?id=50785957
Points: 1
# Comments: 0
