feat: sequence check validator #1
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Essential Elements of an Effective PR Description Checklist
PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS ABOVE HAVE BEEN CONSIDERED.
Purpose
This PR introduces two core validation mechanisms for decentralized inference security according to this proposal - https://github.com/gonka-ai/gonka/blob/main/proposals/inference-validation/inference-validation.md
1. Stage 1 Sequence Check
Implements deterministic verification that each generated token in a submitted sequence appears in the corresponding top-k tokens returned in the inference artifact. This ensures executers cannot pre-generate sequences with a cheaper model and later compute probabilities with a different (claimed) model.
Sequence check logic:
run_seedand top-k tokens from the inference response.This closes the primary pre-fill attack vector for Stage 1.
2. Distribution Check with Live vLLM Inference
Test Plan
Execution environment was validated on both local and server GPUs to ensure consistent results:
Local GPU:
Server GPU:
Both environments successfully executed the vLLM-based distribution check.
Tests cover:
Test Results
Sequence Check Tests
All sequence check tests pass:
Distribution Check Tests (Using Live vLLM)
Distribution check logs confirm:
(Optional) Documentation Update
No documentation update required. The validation logic is fully internal and does not change the public API.