GreenCalculusGet a free key
  1. Home
  2. Guides
  3. Tutorial
  4. How do I stop an LLM inventing emission factors in my product?
Last reviewed September 2026

How do I stop an LLM inventing emission factors in my product?

Quick Answer

Never let the model produce the number. Let it produce a selection: retrieve candidates from a sourced corpus, constrain the output to one real factor key, do the arithmetic in code, and return the citation with the result. Give it a way to say “not held”.

A language model asked for the UK grid factor will answer fluently, confidently and from memory, and memory is exactly where emission factors go wrong: they change every year, they differ by boundary and vintage, and a plausible number is indistinguishable from a right one on the page. The fix is not a better prompt. It is an architecture in which the model is not the authority for any value, and every value that reaches the user carries the publisher, the cell and the version that would let someone check it.

How badly models guess, measured

We put 467 emission-factor questions to five frontier models with no tools and no web access, and scored each answer against the sourced value. Accuracy within 10% ran from 42% to 65% depending on the model, with refusals counted as misses. The pattern that matters for product design is the second one: a model would name the correct publisher and dataset and still return a wrong number, in up to 59% of the correctly attributed answers. The citation looked right; the value was invented. The full study, every question and every raw answer are on How accurate is AI on emission factors?, and the breakdown by category is on where AI is reliable and where it is not.

Split matching from maths

Emission-factor work is two tasks that need opposite tools. Matching is semantic: turn “1,200 litres of diesel for a UK fleet in 2025” into the right row of the right dataset. Models are genuinely good at this. Lookup and arithmetic are not semantic at all: read the value at that key, multiply, carry the units. Models are unnecessary and unreliable here. Let the model do the first and only the first.

Constrain the output to a real key

  1. Retrieve the top candidates for the description from the corpus. Hybrid search, name plus key plus publisher, works well; a reranker helps more than a bigger model.
  2. Pass only those candidates into the model’s context, with their keys.
  3. Force structured output whose factor field is an enum of the retrieved keys, or null. Reject anything that is not one of the keys you supplied.
  4. Look the chosen key up in code, do the arithmetic in code, and attach the citation the lookup returned: publisher, source cell, data version, licence.

If the model can only emit an identifier from a closed set, invention becomes structurally impossible rather than statistically unlikely. The number never passes through the model at all.

Make “not held” a first-class answer

Most invented factors appear because the system had no way to say there was no good match, so the model filled the gap. Set a similarity floor below which the answer is null; route those to a human queue or an explicit gap message. The corpus goes one step further: an absence record says why a factor is not held, whether the gap is structural, on the backlog, or a licence we refused, so the product can tell the user something true instead of something plausible.

Wire it: the tools that do this

The MCP tools on mcp.greencalculus.com that map onto the four steps above. Two answer without a key at all.
Step Tool What it does
Retrieve candidates search_factors (no key needed) Search the corpus by name, key, publisher or geography
Match a description resolve_factor Turn plain language into ranked factor keys
Look up and calculate in code lookup_factor, calculate_activity One factor with full provenance; activity times factor with the arithmetic shown
Say why it is not held explain_absence (no key needed) Structural, backlog or licence-refused, instead of leaving the caller to guess

The same tools are a pip-installable LangChain package for agents written in Python, and plain HTTP for everything else: carbon data your agent can cite and emission factors in LangChain agents. Whatever the transport, the response is the envelope your product should show the user: the value, the publisher, the source reference, the data version, and a public proof link.

Test it before you trust it

Take twenty questions your users actually ask, run them through the product, and check three things per answer: does the number match the corpus value at the stated key, is the citation the one the lookup returned, and did the system say “not held” where it should have. Our published question set and scorer are open, so you can reuse them as a regression suite: see the accuracy study for the repository and the DOI.

Frequently asked questions

Take the number out of the model’s hands. Retrieve candidate factors from a sourced corpus, constrain the model’s output to one real key from that set, look the value up and do the arithmetic in code, return the citation with the result, and give the system a way to say a factor is not held. The GreenCalculus MCP tools implement each step.

No. A prompt lowers the rate of invention; it cannot make it impossible, and a wrong factor that looks right is worse than a refusal. Only an architecture in which the value never passes through the model removes the failure.

It changes the failure mode from “confidently wrong” to “visibly sourced”, provided the tool returns provenance and the product shows it. A tool that returns a bare number has moved the guess, not removed it. Check that every value your users see carries a publisher, a reference and a version.

The value and unit, the publisher and dataset, the source cell or key, the data version, and a link a reader can open to verify it. That is the five-field citation from how to cite an emission factor, and it is what turns an AI answer into something an auditor will accept.

Scroll to Top