惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
Netflix TechBlog - Medium
G
Google Developers Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
GbyAI
GbyAI
L
LangChain Blog
云风的 BLOG
云风的 BLOG
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
小众软件
小众软件
WordPress大学
WordPress大学
A
About on SuperTechFans
大猫的无限游戏
大猫的无限游戏
C
Check Point Blog
月光博客
月光博客
Stack Overflow Blog
Stack Overflow Blog
美团技术团队
Jina AI
Jina AI
T
Tailwind CSS Blog
Google DeepMind News
Google DeepMind News
D
Docker

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Query The Quantum
Devyani Shin · 2026-05-13 · via DEV Community
  • Benchmarking GraphRAG vs. Basic RAG vs. LLM‑Only on 2M+ Quantum Computing Research Papers 1. The Problem Large language models (LLMs) incur significant operational costs due to high token consumption, especially when answering complex, multi‑hop questions. Conventional retrieval‑augmented generation (RAG) based on vector similarity retrieves semantically similar text chunks but cannot reason across entities and relationships. As a result, context windows are flooded with redundant information, leading to increased latency and expense.

GraphRAG addresses this limitation by constructing a knowledge graph of entities and their connections, enabling focused multi‑hop retrieval. This project, developed for the TigerGraph GraphRAG Inference Hackathon, demonstrates that GraphRAG reduces token usage by more than 60% while improving answer accuracy compared to vector‑based RAG.

2. Dataset
Domain: Quantum computing research papers.

Source: arXiv categories quant-ph, cond-mat, physics.

Volume: over 2 million tokens (approximately 4,500 paper abstracts and metadata).

Characteristics: rich in entities (authors, algorithms, hardware) and relationships (citations, co‑authorship, hardware‑algorithm links). This structure makes it ideal for testing multi‑hop reasoning queries, e.g., “What links exist between quantum error correction advances and IBM’s Eagle processor milestones?”

3. Pipeline Implementations
Three independent pipelines were built and benchmarked on the same dataset.
LLM‑only pipeline
Methodology: Direct prompting without retrieval.
Components: Groq llama-3.3-70b-versatile (free tier).
Output: Answer, token count, latency (ms), cost (USD).

Basic RAG pipeline
Methodology: Vector similarity search + LLM.
Components: fastembed (BAAI/bge‑small‑en‑v1.5) for embeddings, ChromaDB (persistent) as vector store, Groq for final answer generation.
Output: Answer, token count, latency (ms), cost (USD).

GraphRAG pipeline
Methodology: Knowledge graph traversal + LLM.
Components: TigerGraph Savanna (graph GraphRAG_Hackathon with vertices Entity, Chunk and edge has_entity), GSQL multi‑hop queries, Groq for final synthesis.
Output: Answer, token count, latency (ms), cost (USD).

All three pipelines execute in parallel and return answer text, token count, latency (ms), and cost (USD).

4. Dashboard Overview
A single‑page Streamlit dashboard was developed with a dark, glassmorphic user interface. Key features include:

Quantum circuit visualisation (Bell state generated with Qiskit)

Central query input and submission button

Three collapsible cards, one per pipeline, displaying answer text and metrics: tokens, latency, cost

Dynamic bar chart comparing token consumption for the submitted query

The dashboard integrates seamlessly with all three pipelines and serves as the primary interface for live testing and demonstration.

5. Benchmark Results
Accuracy was evaluated on a set of ten representative ground‑truth questions. Two complementary metrics were used:

LLM‑as‑Judge (PASS/FAIL): TinyLlama‑1.1B‑Chat (local inference) evaluates whether the generated answer is factually correct relative to a reference answer.

BERTScore F1 (rescaled): bert-score library with rescale_with_baseline=True measures semantic similarity.

The LLM‑only pipeline achieved an LLM‑as‑Judge pass rate of 80.0% and a BERTScore F1 (rescaled) of 0.0614. The Basic RAG pipeline scored 70.0% pass rate and 0.1074 BERTScore. The GraphRAG pipeline outperformed both with a 90.0% pass rate, meeting the bonus threshold, while its BERTScore was 0.0468. All pipelines incurred zero cost per query, as they operate on free tiers.

Observations

GraphRAG achieves the highest pass rate (90%), meeting the hackathon’s bonus threshold (≥90%).

Basic RAG (70%) and LLM‑only (80%) trail behind, confirming that graph‑based retrieval improves correctness for multi‑hop questions.

BERTScore values are low because reference answers are detailed and lengthy, while pipeline answers are concise. The LLM judge focuses on factual correctness and consistently rates GraphRAG answers as correct. The low BERTScore does not contradict the pass rate; it reflects stylistic differences, not factual inaccuracies.

All pipelines operate on the free tier, resulting in zero cost per query. Typical token reduction for GraphRAG versus Basic RAG (observed in single‑query measurements) exceeds 60%, with latency reductions of 20‑30%.

6. Why GraphRAG Outperforms
Multi‑hop retrieval: The GSQL query traverses Entity → Chunk → Entity → Chunk, capturing interconnected context that vector similarity cannot access.

Focused context: Only relevant, linked chunks are returned, reducing noise and token consumption.

Higher accuracy: The 90% pass rate on relational queries demonstrates superior reasoning capabilities for scientific domains.

7. Reproducibility and Resources
All source code, configuration examples, and evaluation scripts are available in the public GitHub repository.

Repository:[https://github.com/Mscomplex27/QueryTheQuantum]

Setup: Clone the repository, create a Python virtual environment, install dependencies, and configure a .env file with your GROQ_API_KEY and TigerGraph Savanna credentials.

8. Conclusion
GraphRAG delivers superior answer correctness (90% pass rate) compared to vector‑based RAG (70%) and LLM‑only (80%), while simultaneously reducing token consumption and latency. For production AI systems where both accuracy and cost efficiency are critical, graph‑augmented retrieval provides a compelling advantage. The methods and code presented here are fully reproducible and can be adapted to other knowledge‑intensive domains beyond quantum computing.

Acknowledgment
This work was conducted as part of the TigerGraph GraphRAG Inference Hackathon, using TigerGraph Savanna (free tier), Groq LLM (free tier), and open‑source libraries.