ruvnet / ruvnet/RuVector

Feature Request: Integrate DFlash Block Diffusion Speculative Decoding

Open
#341 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
4.5k
Forks
603
Avg merge
23h 32m
Merged PRs (30d)
59

Description

What is DFlash?

DFlash is a breakthrough speculative decoding technique introduced in the paper DFlash: Block Diffusion for Flash Speculative Decoding (Feb 2025).

Instead of traditional autoregressive draft models, it uses a lightweight block diffusion model (~5 layers) that generates an entire block of draft tokens in a single forward pass via parallel denoising. The draft model is conditioned on hidden/context features extracted from the target LLM (injected into the draft model's KV cache). The target LLM then verifies the whole block in parallel.

Key results (lossless, distribution-preserving):

  • >6× speedup on models like Qwen3.5, LLaMA-3.1 series across Math500, LiveCodeBench, GSM8K, etc.
  • Up to 2.5× faster than the previous SOTA (EAGLE-3)
  • Much higher acceptance rates and GPU utilization

Resources:

Why this fits RuVector perfectly

ruvLLM already ships state-of-the-art inference features:

  • Speculative decoding (currently ~2-3× speedup, auto-detect draft models)
  • FlashAttention-3 (and 50+ other attention mechanisms)
  • Paged KV cache, continuous batching, quantization, Metal/CUDA/WebGPU/WASM backends
  • Self-learning SONA + GNN system that learns from query feedback/trajectories

DFlash is the natural evolution of the existing speculative decoding path. A Rust-native block diffusion drafter would deliver massive additional gains especially for:

  • Agentic generation & routing
  • Graph RAG + synthetic data flows
  • Real-time local inference (edge/browser/postgres extension)
  • Self-optimizing workloads (SONA could dynamically tune block size, conditioning features, or draft parameters)
Proposed implementation
  1. Add native support for DFlash-style block diffusion drafting inside crates/ruvllm and ruvector-attention
  2. Support loading pre-trained DFlash drafters (or convert from HF → GGUF/ONNX)
  3. Enable conditioning on target LLM hidden states (already possible with current KV/attention infrastructure)
  4. Make block size configurable + let SONA/GNN auto-adapt it from usage patterns
  5. Optional: expose new high-level APIs (e.g. ruvector_dflash_generate_block(...) in the PostgreSQL extension)
Expected impact
  • Significantly higher throughput and lower latency while staying 100% lossless
  • Strengthens RuVector’s position as the fastest self-learning local AI memory + inference engine
  • Keeps us ahead of llama.cpp / vLLM / Ollama in the speculative decoding space

Happy to help test, benchmark, or even contribute code/PRs once the direction is clear. Let me know how I can support the implementation!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing speculative decoding path in crates/ruvllm and the KV/attention infrastructure in ruvector-attention. Define the integration scope, drafter loading or conversion path, configurable block size, and optional PostgreSQL API before implementation; done requires native DFlash-style drafting with lossless verification and benchmarks.

Written by the indexing model from the issue text.

Assessment

Tech stack
huggingface, postgresql, rust
Domain
ai, backend, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.