feat: offline safetensors ablation, async vLLM benchmarking, and polysemantic eval#11
Open
RUFFY-369 wants to merge 5 commits into
Open
feat: offline safetensors ablation, async vLLM benchmarking, and polysemantic eval#11RUFFY-369 wants to merge 5 commits into
RUFFY-369 wants to merge 5 commits into
Conversation
… test - Add extract_circuit.py for contrastive neuron attribution (CNA) discovery. - Map canonical 458-neuron refusal circuit to canonical_indices.json. - Implement apply_surgery.py to bypass runtime hooks and hard-ablate gate_proj, up_proj, and down_proj directly within .safetensors binaries. - Add stress_test.py to validate long-context autoregressive stability via vLLM. - Include post-mortem logs demonstrating polysemantic entanglement and code-correctness collapse at 4.8k tokens.
…est to production-grade - Add argparse interface to make paths portable across environments. - Inject ablation indices directly into .safetensors header metadata for model provenance. - Optimize host RAM safety in apply_surgery.py via strict garbage collection. - Re-implement stress_test.py as an asynchronous streaming client with exponential backoff and load statistics.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📌 Overview
Introduces an offline ablation pipeline to bypass PyTorch runtime hooks. This enables native deployment to high-throughput engines (vLLM/TGI) with zero Time-To-First-Token (TTFT) or Inter-Token Latency (ITL) overhead. Includes async load generation and documents a novel capability drift boundary condition.
🛠️ Architectural Implementation
gate_proj,up_proj, anddown_proj..safetensorsmetadata header for architectural provenance.AsyncOpenAI.🔬 Empirical Findings: Polysemantic Entanglement
Stress-testing the offline-ablated Llama-3.1-8B-Instruct (0.1% refusal circuit, localized to L30/31) against a 4.8k-token prefix revealed a semantic reasoning flaw undetected by standard n-gram repetition metrics.
Warning
Observation: The ablation successfully bypassed the refusal state without triggering an EOS-avoidance loop. The model maintained perfect structural fluency (flawless Markdown and syntax). However, it suffered a complete semantic collapse, generating logically invalid code (e.g., hallucinated C functions, floating if-statements, string-literal misassignments).
Important
Conclusion: Late-layer refusal neurons are mathematically entangled with logical code-correctness circuits. Ablation maintains the "shape" of a valid response while quietly lobotomizing downstream reasoning.
📂 Verification & Reproducibility
Raw evidentiary logs demonstrating this semantic collapse are fully committed and preserved in:
cc @samherring99 @DamascusGit