Skip to content

research(nightly): graph-topology-aware-quant — hub-aware SQ4/SQ8 mixed precision#665

Draft
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-07-12-graph-topology-aware-quant
Draft

research(nightly): graph-topology-aware-quant — hub-aware SQ4/SQ8 mixed precision#665
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-07-12-graph-topology-aware-quant

Conversation

@ruvnet

@ruvnet ruvnet commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

Adds nightly RuVector research for Graph-Topology-Aware Quantization (TAQ): assigning SQ8 (8-bit) precision to hub nodes and SQ4 (4-bit) precision to leaf nodes in a k-nearest-neighbor graph, achieving better recall than uniform SQ4 at lower memory than uniform SQ8.

  • Recall@10: 0.9652 vs UniformSQ4's 0.8194 (+14.6pp) at only +9% more memory
  • Memory: 21% of f32 baseline vs SQ8's 25% — TAQ saves 16% vs SQ8 while losing only 2.1pp recall
  • Acceptance test: PASS — TAQ recall ≥ SQ4 recall AND TAQ memory ≤ SQ8 memory

What's Included

  1. Working Rust PoCcrates/ruvector-taq/ with 4 index variants and 15 passing unit tests
  2. ADRdocs/adr/ADR-272-graph-topology-aware-quant.md
  3. Research documentdocs/research/nightly/2026-07-12-graph-topology-aware-quant/README.md
  4. SEO gistdocs/research/nightly/2026-07-12-graph-topology-aware-quant/gist.md
  5. Real benchmark results — captured from cargo run --release -p ruvector-taq --bin benchmark

Key Benchmark Numbers

Variant Recall@10 Memory Mem%
FullPrecision-f32 1.0000 1,250 KB 100%
UniformSQ8 0.9864 312 KB 25%
UniformSQ4 0.8194 156 KB 12.5%
TAQ-mixed 0.9652 262 KB 21%

Hardware: x86_64 Linux. Rust 1.94.1. N=5,000, D=64, Q=500, K=10.

Algorithm

  1. Build k-NN graph (k=8) over N input vectors — O(N²·D) brute-force.
  2. Compute in-degree per node (how many nodes list it as a nearest neighbor).
  3. Classify: in_degree > threshold → hub (SQ8), else → leaf (SQ4).
  4. Fit separate quantization params per class; encode and store.
  5. Search: dequantize each stored vector at query time; compute squared Euclidean; return top-K.

Ecosystem Connections

  • ruvector-graph + ruvector-mincut — graph primitives for topology discovery
  • ruvector-agent-memory — TAQ as compression backend for episodic memory
  • cognitum-gate-kernel — edge deployment with TAQ as memory substrate
  • ruvector-proof-gate — combine for precision-upgrade access control
  • rvf / RVF format — serialize TAQ index to portable cognitive package
  • MCP tools — memory_compress(), memory_search_compressed() as agent primitives
  • ruFlo — automated memory hygiene trigger on memory growth

Research doc

docs/research/nightly/2026-07-12-graph-topology-aware-quant/README.md

ADR

docs/adr/ADR-272-graph-topology-aware-quant.md

Build and Test

cargo build --release -p ruvector-taq
cargo test -p ruvector-taq        # 15 tests pass
cargo run --release -p ruvector-taq --bin benchmark

Generated by Claude Code

Introduces Topology-Aware Quantization (TAQ): hub nodes in the k-NN graph
receive SQ8 precision and leaf nodes receive SQ4. Measured result: recall@10
0.9652 at 21% of f32 memory — 14.6pp better than uniform SQ4 at only 9%
more memory, and 4% less memory than uniform SQ8.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_012ZGXfCgLGFEJwKoyeuKYSC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants