Views
No views yet
1# Download benchmark suite
2git clone https://huggingface.co/aurekai/semantic-cache-bench
3cd semantic-cache-bench
4
5# Run quick benchmark
6akai semantic-cache:bench \
7 --dataset queries-10k.jsonl \
8 --model qwen3-8b \
9 --cache-size 1GB \
10 --output results.json
11
12# Compare results
13akai semantic-cache:compare \
14 --baseline baseline-results.json \
15 --current results.json1{
2 "id": "q_001_234",
3 "query": "What are the benefits of renewable energy?",
4 "semantic_variations": [
5 "Advantages of wind and solar power",
6 "Why should we invest in renewables?"
7 ],
8 "dissimilar_queries": [
9 "How do fossil fuels work?"
10 ],
11 "expected_cache_hit": true,
12 "similarity_threshold": 0.87
13}| Metric | Qwen3-8B | LLaMA3-8B | Meaning |
|---|---|---|---|
| Hit Rate | 71.2% | 69.8% | % of queries found in cache |
| False Positives | 0.3% | 0.4% | Incorrect cache matches |
| False Negatives | 2.1% | 2.4% | Missed cache opportunities |
| Recall @ 0.90 | 94.2% | 92.8% | True positives at high threshold |
Cache Miss: 125 ms (full inference)
Cache Hit: 2 ms (embedding lookup + cache retrieval)
Speedup: 62.5x
Average (71% hit rate): 125*0.29 + 2*0.71 = 38 ms
Effective speedup: 3.3x vs. no cache1# Benchmark specific model
2akai semantic-cache:bench \
3 --model qwen3-8b \
4 --dataset queries-10k.jsonl \
5 --batch-size 32 \
6 --cache-size 2GB \
7 --output results.json
8
9# With logging
10akai semantic-cache:bench \
11 --model qwen3-8b \
12 --dataset queries-10k.jsonl \
13 --cache-size 2GB \
14 --verbose \
15 --log-interval 100 \
16 --output results.json1# Run on multiple models
2for model in qwen3-8b llama3-8b; do
3 akai semantic-cache:bench \
4 --model $model \
5 --dataset queries-10k.jsonl \
6 --output results-$model.json
7done
8
9# Compare results
10akai semantic-cache:compare \
11 --results results-qwen3-8b.json results-llama3-8b.json \
12 --report comparison-report.md1# Test different similarity thresholds
2akai semantic-cache:threshold-sweep \
3 --model qwen3-8b \
4 --dataset queries-10k.jsonl \
5 --thresholds "0.80,0.85,0.90,0.95" \
6 --output threshold-sweep.json| Model | Dataset | Hit Rate | P@0.90 | Latency (hit) | Latency (miss) |
|---|---|---|---|---|---|
| Qwen3-8B | 1K | 72.3% | 94.1% | 1.8ms | 124ms |
| Qwen3-8B | 10K | 71.2% | 93.8% | 1.9ms | 126ms |
| LLaMA3-8B | 1K | 70.1% | 92.4% | 2.1ms | 127ms |
| LLaMA3-8B | 10K | 69.8% | 92.1% | 2.2ms | 129ms |
1{
2 "semantic_cache": {
3 "enabled": true,
4 "similarity_threshold": 0.88,
5 "max_cache_size": "2GB",
6 "eviction_policy": "lru",
7 "embedding_model": "qwen3-8b",
8 "batch_size": 32,
9 "use_mmap": true
10 }
11}1# For each cached result:
21. Verify embedding matches original query
32. Re-rank all cached results for current query
43. Confirm top match was indeed in cache
54. Validate latency was significantly improved1{
2 "metadata": {
3 "hardware": "NVIDIA H100, 512GB RAM",
4 "date": "2026-05-02",
5 "aurekai_version": "0.8.0-alpha.1"
6 },
7 "results": [
8 {
9 "model": "qwen3-8b",
10 "dataset": "queries-10k",
11 "hit_rate": 0.712,
12 "recall_at_0_90": 0.938
13 }
14 ]
15}akai semantic-cache:bench: Run full benchmark suiteakai semantic-cache:compare: Compare benchmark resultsakai semantic-cache:threshold-sweep: Test different thresholdsbenchmark_to_csv.py: Export results to CSV formatvisualize_results.py: Generate performance plots1@dataset{aurekai_semantic_cache_bench_2026,
2 title={Aurekai Semantic Cache Benchmarks},
3 author={Aurekai Community},
4 year={2026},
5 url={https://huggingface.co/aurekai/semantic-cache-bench}
6}