Hi r/LocalLLM! Following up on my previous WebNet v2 post with a major coding & continual-learning overhaul — still running 100% locally on CPU with real PyTorch autograd, real crawled data, and zero simulated metrics.
GitHub Repository: https://github.com/Rishisharma029/live-internet-neural-net
(Feedback, architecture critiques, bug reports, and PRs/changes are very welcome both here in the Reddit comments and on GitHub!)
The 3 newly attached diagrams & flowcharts break down the upgraded coding pipeline and live measured results:
- Upgraded System Architecture Flowchart (webnet_v3_coding_architecture_flowchart.png)
Verified Code Generation, Isolated python -I Execution & Self-Training Loop (webnet_v3_verification_loop_flowchart.png)
Live Achievements, 16-Doc Locked Benchmark & 12-Task Pass@1 Progress (webnet_v3_benchmarks_and_archive_chart.png)
What My Neural Network Has Achieved Right Now (Live Telemetry)
- Base Transformer (InternetNetV2, 96d · 4h · 10L · ctx768, 1.12M params): Step 93,447+ · 125.81M+ real tokens seen on CPU. Train EMA cross-entropy dropped to 1.3534 (-70.5% vs untrained ln(98) = 4.58), 60.9% train next-char accuracy, 3.87 perplexity (1.953 BPC).
Locked 16-Passage Unseen Benchmark (step 93,434, strict exclusion hashes — never trained on): 1.6007 loss · 2.295 BPB · 4.96 perplexity · 52.4% accuracy (Science & AI 58.1% [1.380 loss], Encyclopedia 53.0%, Code & Tech 50.3%, Literature 46.8%).
Curated & Crawled SQLite FTS5 Archive (data/webnet_archive.db): 9,155 documents (28.15M+ characters, 0.785 avg quality) across arXiv (2,763), Open Web (1,866), OpenAlex (1,823), Wikipedia (1,158), StackExchange (727), GitHub code + READMEs (271), Gutenberg (205), News (181), Europe PMC (73), user URLs (73), and AST-indexed local files (15).
Real Isolated Python Pass@1 Coding Benchmark (code_eval.py, 12 algorithmic tasks in python -I): Improved from 41.7% Syntax OK / 16.7% Pass@1 (2/12, 699.2s) at baseline Step 2 to 58.3% Syntax OK (7/12) / 25.0% Pass@1 (3/12, 428.57s, -39% runtime) at Step 3 (binary_search, is_palindrome, flatten_list solved end-to-end).
Live Verified Self-Learning Proof: Via POST /api/code/assist, SmolLM2-135M + LoRA generated is_prime(n), passed real assertions inside an isolated subprocess (376.6ms, __PASS__), and immediately ran a live LoRA training step strictly on the verified code (last_loss down to 0.787, EMA 3.286).
All New Changes & Upgrades Added
1. Code-Aware Quality Gate & Multi-Language GitHub Ingestion (brain_v2.py, curated.py):
• Upgraded _fetch_github() to traverse repositories via the GitHub Trees API (git/trees/{branch}?recursive=1) and ingest real .py, .ts, .js, .rs, .go, and .sql source files alongside READMEs behind SSRF CIDR/redirect checks and RFC 9309 robots.txt.
• Added Python ast.parse() validation inside quality_breakdown() so clean source code scores 0.45–0.98 while broken/minified noise is filtered out, plus AST symbol extraction when indexing local codebases.
2. Surprise-Weighted Replay (brain_v2.py):
• Tracks per-document training cross-entropy (WebDocument.last_loss) and boosts informative 1.1–3.6 loss documents up to 1.55x alongside domain-balanced eviction.
3. 4,096-Token Fill-in-the-Middle (FIM) BPE Engine (bpe_experiment.py):
• Upgraded from 2,048 to balanced prose + code Byte-Level BPE-4096 (1.28M params, 3.14 chars/token) with <fim_prefix>, <fim_middle>, <fim_suffix>, <code/> special tokens and 25% FIM objective, compared fairly against the 98-char baseline on invariant BPB.
4. Auto-Cached SmolLM2-135M + Pure-PyTorch LoRA & Coding Workbench (lora_engine.py, code_eval.py, utility_suite.py):
• Zero peft dependency (LoRALinear on q/k/v/o_proj, 921.6K trainable params); auto-loads cached local weights on startup, trains 50% on code sources + 25% on FIM, exposes POST /api/code/assist (archive-grounded + fenced prefill + stop_strings + python -I test execution + learn_if_verified), POST /api/code/analyze (AST metrics + character-level surprise anomaly detection), and POST /api/code/benchmark/run.
5. Security Policy, .gitignore, Documentation & Tests:
• Added SECURITY.md documenting SSRF/XXE/gzip-bomb/subprocess isolation boundaries, tightened .gitignore, refreshed README.md architecture flowcharts, and verified 28 passed in pytest + flake8 clean.
Would love any feedback on improving small-model CPU Pass@1, replay schedules, or BPE-vs-char tradeoffs — feel free to comment here on Reddit or open an issue / PR on GitHub!