You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Extract run_seed and top-k tokens from the inference response.
Align generated tokens with the top-k lists using the shared seed.
Validate that every generated token is included in its respective top-k list.
Fail validation if any mismatch occurs.
This closes the primary pre-fill attack vector for Stage 1.
2. Distribution Check with Live vLLM Inference
Test Plan
Make sure to build vllm with the run_seed changes - gonka-ai/vllm#13
Execution environment was validated on both local and server GPUs to ensure consistent results:
Local GPU:
NVIDIA GeForce RTX 4060 Ti
Server GPU:
NVIDIA GeForce RTX 4070
Both environments successfully executed the vLLM-based distribution check.
cd decentralized-api
go test -v ./internal/validation/
Here is the short recap of the review with the main points:
Validator container and validator package aren't necessary.
We don't need the separate container for inference validation, we can deploy vllm by sending a /inference/up command to MLnode. Inference and validation are executed using the same vllm endpoint, the difference is in sampling and enforced_tokens.
A variation of distribution check is already implemented and it is basically the current form of validation, so we don't need to implement or test it.
checkSequenceFromArtifact is a simplified sampling check, that this imrovement is intended to target.
the core idea is to implement the check: given tokens are indeed sampled from the given logprobs with the given seed. I didn't find the test, that evaluates that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
Make sure to build vllm with the
run_seedchanges - gonka-ai/vllm#13Execution 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.