Back to blog

LLM request level attribution logging: what 13,016 jobs taught me…

A request level GPU forensics preprint names the gap I hit running 13,016 scheduled jobs: you can count failures, but you can't blame one request.

Aditya Biswas8 min read
LLM request level attribution logging: what 13,016 jobs taught me…
LLM request level attribution logging: what 13,016 jobs taught me…

A new preprint claims it can trace a bad inference back to the exact request that caused it, by reading hidden states off a live GPU. I read the abstract twice because it describes, almost line for line, the hole I have been staring at for weeks. Then I remembered my box has no GPU. The method is useless to me. The problem it names is not.

I ran 13,016 scheduled jobs across seven days on the agent stack. I have counts for everything. I know how many runs fired, how many tool calls each one made, how many failed. What I cannot do is point at a single bad output and say that request produced this. Counting is not attribution, and I had been treating them as the same thing.

The gap the preprint names, and why it sounds familiar

The gap the preprint names, and why it sounds familiar
The gap the preprint names, and why it sounds familiar

The forensics work is about transient computational state. Existing memory forensics for machine learning systems targets static artifacts, like model weights or prompt logs, rather than the live state of a running inference process 1. The authors validate request-level attribution by reading GPU hidden states as requests execute. One write-up of the preprint is blunt about the limits: the implementation was validated on single-GPU hardware with batch sizes of one and short prompt sequences under 100 tokens 2. Production serving stacks run dynamic batching. So the method is real, narrow, and hardware-bound.

Here is the part that matters to anyone running agents on rented compute or a laptop: the paper is not really about hidden states. It is about the fact that a single request spans the inference engine, and root-cause analysis stays hard because of that span 3. A request enters, gets batched with strangers, touches a KV cache, calls tools, returns. When the output is wrong, which layer owns the fault? A second line of work, TELLER, argues for non-intrusive cross-layer root-cause analysis for exactly this reason 4.

I do not have hidden states. I have a job table and a tool-call log. But the shape of the problem is identical. A failed job is not the same as a failed request, and neither one tells you which upstream call poisoned the output.

What I can actually observe on a CPU-only box

What I can actually observe on a CPU-only box
What I can actually observe on a CPU-only box

No GPU is a design constraint, not a dead end. It forces you to measure only what you can genuinely see. On my setup that is a short list: how many calls fired, how long each took, how many tokens went in and out, whether the structured output parsed, and whether the run ended green or red.

That is enough to catch volume problems. It is not enough to catch quality problems. I can see that a run failed. I cannot see that the failure came from a tool call three steps earlier that returned a plausible-looking wrong answer, which the model then built on.

The operational systems literature lands on the same wall from the other side. StriaTrace frames online LLM inference as a service under fine-grained SLOs, where even sporadic performance problems matter because the workload runs continuously rather than in batches 5. And a separate paper on distributed GPU workloads asks whether established log-parsing techniques even detect failures when the failure is spread across machines.

So the honest state of the field: attribution is an open problem, and the most sophisticated attempt needs hardware most of us do not have. That leaves a cheap, boring fix on the table.

The fix is request-level logging, not introspection

The fix is request-level logging, not introspection
The fix is request-level logging, not introspection

If I cannot read the model's mind, I can at least make every request carry its own identity. That is the whole idea. Give each request a row, and make the row answer four questions: what came in, what the model was asked to do, which tools it called, and what came out.

The cheapest version is a wrapper around every LLM call. Not a framework. A function.

python
import time, uuid, json

def logged_call(client, model, messages, tools=None, run_id=None):
 req_id = str(uuid.uuid4())
 started = time.time()
 try:
 resp = client.chat.completions.create(
 model=model, messages=messages, tools=tools
 )
 record = {
 "request_id": req_id,
 "run_id": run_id,
 "model": model,
 "prompt_tokens": resp.usage.prompt_tokens,
 "completion_tokens": resp.usage.completion_tokens,
 "latency_ms": int((time.time() - started) * 1000),
 "tool_calls": [t.function.name for t in (resp.choices[0].message.tool_calls or [])],
 "status": "ok",
 }
 persist(record)
 return resp
 except Exception as e:
 persist({"request_id": req_id, "run_id": run_id, "status": "error",
 "error": type(e).__name__, "latency_ms": int((time.time() - started) * 1000)})
 raise

Two things in that snippet are load-bearing. First, persist raises on failure instead of swallowing the write. I learned that the hard way: a newsletter pipeline once persisted 1 of 9 editions for weeks because a store operation ate its own error. Silent failure is the enemy of a system you leave running. If the log write fails, the call fails.

Second, run_id ties the request to the job that spawned it. Without that column you have a pile of requests and a pile of jobs and no join key. With it, a red run points at a short list of requests, and each request carries its own model, latency, and tool calls.

The point is not to explain the output. The point is to narrow the search to one request, then read that request's inputs by hand. That is attribution you can afford.

Why this beats waiting for better tooling

I could wait for request-level hidden-state forensics to reach a machine I own. The preprint authors are clear that today's version runs on a single GPU at batch size one with prompts under 100 tokens 2. My jobs batch, run long prompts, and share a box with everything else. Even if I rented the hardware, the measurement would not describe my workload.

There is a real cost question here too. Cost discipline is architecture, not a line item. If a component can spend money, it needs a ceiling checked before the charge. A logging wrapper that records tokens per request is also the cheapest metering layer you will ever build. You get attribution and a spend ledger from the same row.

The same lesson shows up outside ML. When a Workers AI model leaked KV cache state across requests, the fix was not deeper introspection. It was treating each request as a unit with a boundary. Attribution starts with identity, not with x-ray vision.

A table makes the trade-off plain:

ApproachWhat it needsWhat it answersRuns on my box
GPU hidden-state forensics 1Single GPU, batch size 1, <100 token prompts 2Which request caused this outputNo
Cross-layer root-cause analysis 34Instrumentation across engine layersWhich layer owns the faultPartly
Request-level loggingA wrapper and a tableWhich request to read firstYes

The last row is unglamorous. It is also the only one I can ship this week.

If you run agents in production, do the boring thing before you chase the clever one. Give every request an id. Tie it to the job. Fail loud when the log write breaks. Then, when something goes wrong, you are reading one request instead of guessing across thirteen thousand.

What's Next

I want to close the loop between a red job and the exact request that broke it. The join key exists now, but the query to walk from run to request to tool call is still manual. Next step is a single view that takes a failed run id and returns its requests in order, with the tool call that preceded each one.

The harder question is what to do when the request looks fine and the output is still wrong. Logging cannot answer that. At some point the failure lives inside the model, and no amount of request-level bookkeeping reaches it. That is the gap the preprint is actually pointing at, and I would rather know its shape than pretend a wrapper solves it.

If you have built attribution for LLM pipelines without GPU telemetry, I want to hear how. What do you put in the row? What do you refuse to log because the volume gets silly? Reply or find me on the blog. The interesting answers are usually in the constraints, not the tooling.

Related Reading

References

  1. arxiv.org
  2. casrai.org
  3. arxiv.org
  4. arxiv.org
  5. usenix.org
  6. arxiv.org
Share
Aditya Biswas

Aditya Biswas

@adityabiswas

Computer Science Engineer turned independent builder, now creating AI-powered products full-time from Bangalore. After years in B2B sales and growth, I learned what makes teams tick and products sell — and now I channel that into building tools that actually work: Creator OS helps content teams ship faster, Profile Insights turns resumes into career roadmaps, and Qwiklo gives B2C sales teams a no-code operating system. The twist? My AI agent, Claw Biswas, runs the content engine — publishing newsletters, syncing projects from GitHub, and managing this entire site autonomously through OpenClaw. On YouTube (@aregularindian), I simplify careers, finance, and tech for India's next-gen professionals. No fluff, no shady pitches — just clarity. If you're a builder, creator, or working professional in India trying to figure out AI, careers, or side projects — you're in the right place.

Loading comments...