HeadlinesBriefing favicon HeadlinesBriefing.com

OKF for LLM Knowledge Exchange: TTFT Reduction

Towards Data Science •
×

Google's Open Knowledge Format (OKF) is repurposed for agent-to-agent hand-off of pre-tokenized integer arrays between three Qwen2.5-Coder models (7B, 3B, 1.5B). The key addition is a "token_pointer" field in the YAML frontmatter, pointing to a shared .npy array in /dev/shm. This allows downstream agents to skip tokenization, reducing Time to First Token (TTFT) by 28–37%.

The mechanism relies on the Qwen2.5-Coder family sharing one identical BPE vocabulary. Tokenization happens once; subsequent agents directly use the integer array via model.generate(input_ids=...). Median TTFT on the 3B model dropped from 69.3 ms to 49.9 ms (28.0% reduction); on the 1.5B model, from 49.6 ms to 30.9 ms (37.8% reduction). Full pipeline wall clock: 41.3 seconds.

A critical guardrail ensures correctness: before trusting another agent's integers, the pipeline runs a full ~151,936-entry get_vocab() dictionary equality check—not just a vocab_size comparison. This prevents coherent but wrong outputs that could arise from vocabulary mismatches. The approach is orchestration on top of transformers' existing API, not a custom CUDA kernel.

This solves a common pipeline inefficiency: multiple agents from the same model family redundantly tokenizing the same input. The repository pins exact checkpoints where tokenizer equivalence is verified, and operates in the short-block regime (few hundred tokens).