Log date · Sat
Can LLMs reliably review bytecode?
Single-shot LLM bytecode review needs independent verification. A paper and a Java example show why call paths and verdicts matter.
Can an LLM reliably review bytecode?
A single LLM verdict is not a reliable standalone bytecode review. In The Deception Delta, detection of fund extraction fell from 41.0% on functionally matched controls to 21.0% on deceptive contracts, a 20.0 percentage-point difference. [1] In our separate Java sample, direct and indirect paths both returned 70, but the latter required following another method.
| Question | Finding |
|---|---|
| What did the paper measure? | 22 models, 13 contracts and 8,528 analyzable runs. |
| What changed in our indirect path? | The same subtraction of 30 is in another method. |
| Does this prove obfuscation stops AI? | No; the paper has a specific protocol and scope. |
The paper and its results
Timo Schefold submitted v1 on 12 September 2026 UTC and v2 on 6 October. The study used six prompt strategies on 13 purpose-built contracts: nine deception vectors and four controls. It obtained 8,528 analyzable non-refusal runs. [1] The difference is in percentage points, not a 20% relative decrease.
Multi-hop calls, XOR-masked selectors and storage-loaded parameters resisted detection across nearly all models. Some responses correctly described the extraction mechanism but accepted a benign framing and gave a reassuring verdict. Simple guard instructions gave no aggregate benefit; only five models from two providers exceeded 50% detection. [1]
The paper used a calibrated LLM judge pipeline, two judge-independent measures and 50 human labels from one expert. Its main detection metric conservatively counted an accurately described but rationalized drain as detected, although the paper still treats that reassuring verdict as a practical failure. The central claim concerns single-shot analysis of raw contract bytecode; it does not cover interactive, tool-augmented, source-aware or decompiler-assisted workflows, or estimate deception prevalence in deployed contracts. [1]
A Java illustration of indirection
We compiled and inspected our own Flow.java using javac and javap 17.0.19. The direct path subtracts an amount from a balance; the indirect path calls stage, which performs the same operation. This JVM toy illustrates why calls must be followed: it is not EVM, a replication of the paper or a measurement of LLM detection.
static int direct(int balance, int amount) { return balance - amount; }
static int indirect(int balance, int amount) { return stage(balance, amount); }
private static int stage(int balance, int amount) { return balance - amount; }Both paths received 100 and 30 and produced the same result. This run covers one input pair; understanding the method also requires checking where its arguments come from and when it is called.
direct=70
indirect=70The javap -c option shows bytecode instructions and -private includes private members. [2] The direct method contains isub; the indirect method first executes invokestatic, and the subtraction appears in stage. Looking only at the entry method can miss the operation. Our names and source are available; a real release artifact may provide less context.
static int indirect(int, int);
Code:
0: iload_0
1: iload_1
2: invokestatic #7 // Method stage:(II)I
5: ireturn
private static int stage(int, int);
Code:
0: iload_0
1: iload_1
2: isub
3: ireturnReview the conclusion as well as the mechanism
Break a model report into checkable claims: entry point, call chain, argument origin, state change and final verdict. Link each to instructions, source or a controlled execution record. A correct call-chain description does not establish that the permission or risk judgment is correct; “no issue found” is not evidence by itself.
The table gives engineering recommendations, not benefits measured by our sample. Independent review also needs a defined boundary: a run establishes behavior for its observed inputs and environment, and no static warning does not establish that every composition is safe.
| Question | Finding |
|---|---|
| Model reports benign behavior | Independently trace sensitive operations, permissions and data flow before accepting the verdict. |
| Indirect calls or data-driven dispatch | Record targets and argument origins; test critical branches in a controlled environment. |
| Evaluating your own protection | Fix models, tools, inputs and success criteria; compare interactive workflows. |
| Making an external claim | State the protocol, versions and limitations; do not generalize a single run to all AI. |
Run a check on your own project
Run the sample first, then select a known class from a Java release you are authorized to inspect. Replace the jar and class name in the final command. Record the build version and findings, follow calls to sensitive operations, and check argument sources and reachability. If execution is needed, use controlled data in an isolated test environment.
javac Flow.java
java Flow
javap -c -private Flow
# Substitute your own artifact and class.
javap -classpath path/to/your-release.jar -c -private com.example.YourClassFor a comparison, record the exact input, prompt, model version, tool access and predefined ground truth. Score mechanism identification and the final risk judgment separately, then review false positives and misses. Keep functionally matched controls such as direct and indirect implementations so changes to prompts, programs and tools can be distinguished. Repeat the same checks as models and tools change.
Your checklist
- Record the model, prompt, input and tool access.
- Trace sensitive operations and argument origins.
- Verify mechanism descriptions and risk verdicts separately.
- Use functionally matched controls and controlled inputs.
- Record build versions, false positives and misses; repeat checks.
Primary sources
- arXiv: The Deception Delta: Adversarial Evaluation of LLM-Based Smart Contract Bytecode Forensics (2609.14098) · Source date 2026-09-12 · Checked 2026-10-12
- Oracle: The javap Command · Checked 2026-11-11