retrieval-augmented embedding-projection semantic-reversal spectral-acceleration hn-search legal-retrieval medical-retrieval patent-retrieval
Abstract
Dense-embedding retrievers can fail adversarially: when a query is answered by a document A and reversed by a near-copy B that differs from A by a small meaning-changing edit (a "trap"), raw cosine over E5-Large-v2 places B in the top-10 for 82-100% of queries at a pool of 5,000. We study two things. First, a small learned projection W: R^1024 -> R^d (d in {11, 32}), trained by a deterministic recipe on a declared set of cases, that suppresses the trap: for the declared cases, HN@10 = 0.0000 (no trap in the top-10) in all twelve (domain, pool-size) settings across four independent domains (legal, medical, patent, financial) and pools up to 100,000, while the correct paraphrase is retained for 93-99% of cases, under exact nearest-neighbour search. Second, a boundary-conditioned accelerator that serves the projection at that scale: an acceleration of spectral graph retrieval (SpectRAG) that replaces a dense eigendecomposition with a boundary-value solve, holding HN@10 = 0.0000 at n = 100,000 in every domain and retrieving the ~300-query suite in 0.6-1.1 s (~2-4 ms per query on average). Because the lens's output is the stored representation (a few floats per document), a hardened, specialised index per domain or tenant is ~90x smaller and dimension-proportionally faster than the full embedding, making many small declared indexes a practical alternative to one large vector store. The claim is scoped to the declared cases on the measured pools, with no probabilistic bound; the correct-answer rate drops for a reworded query against an unchanged corpus (about 0.79, trap suppression still holding). A projection transfers only partly to other domains, which we report in full. The recipe, lenses, trap sets and evaluation harness are released under AGPL-3.0; the accelerator's implementation is a reserved commercial component, and every HN number is reproducible under exact search.
한국어 요약
한 줄 요약
E5-Large-v2 기반의 밀집 임베딩 검색기에서 의미 반전 문서(trap)를 제거하기 위한 소형 학습된 투영과 가속화 기법을 4개 도메인에서 실증적으로 검증한 연구.
핵심 기여도
- **소형 학습 투영 W: R^1024 → R^d (d ∈ {11, 32})**을 통해, 선언된 trap 케이스에서 HN@10 = 0.0000 (top-10에 trap 없음)을 달성.
- **SpectRAG**라는 경계 조건 기반 가속기로, 100,000 문서에서 0.6–1.1초 내 300개 쿼리 처리 (평균 2–4ms/쿼리).
- **4개 도메인 (legal, medical, patent, financial)**에서 동일한 코드 경로로 HN@10 = 0.0000 유지.
- **4×4 크로스 도메인 전이 실험**을 통해 투영의 전이 성능을 정량적으로 평가 (11개 쌍은 HN@10 ∈ [0.44, 0.85], 1개 쌍은 HN@10 = 0.2957).
핵심 아이디어
기존 밀집 임베딩 검색기(E5-Large-v2)는 의미가 약간 바뀐 문서(trap)를 top-10에 포함시켜 실질적으로 오류를 유발할 수 있다. 이 연구는 **선언된 trap 케이스에만 집중하는 소형 학습 투영 W**를 제안하며, 이는 **결정론적 레시피**로 학습되어 trap을 top-10에서 제거한다. 투영 W는 **HitC@10 (93–99%)** 수준의 정답 문서 검색 성능을 유지하면서 trap을 제거한다. 이는 기존의 **metric learning에서 사용되는 보존 손실 + 하드-네거티브 힌지 손실** 기반의 학습 방법을 활용하지만, **정확한 레시피와 4개 도메인에 걸친 일관된 실험 프로토콜**을 통해 기존 접근과 차별화된다.
기술적 접근법
- **학습된 투영 W: R^1024 → R^d** (d ∈ {11, 32})는 선언된 trap 케이스에서 HN@10 = 0.0000을 달성.
- **SpectRAG**는 **밀집 고유분해 대신 경계값 문제 해결**을 통해 100,000 문서에서 0.6–1.1초 내 300개 쿼리 처리.
- **HitC@10 (93–99%)** 수준의 정답 문서 검색 성능 유지.
- **4개 도메인 (legal, medical, patent, financial)**에서 동일한 코드 경로로 실험.
- **4×4 크로스 도메인 전이 실험**을 통해 투영의 전이 성능 평가 (11개 쌍은 HN@10 ∈ [0.44, 0.85], 1개 쌍은 HN@10 = 0.2957).
- **AGPL-3.0** 하에 레시피, 투영, trap 세트, 평가 허네스 공개.
주요 결과
- **4개 도메인**에서 **100,000 문서** 풀에서도 HN@10 = 0.0000 유지.
- **HitC@10 = 93–99%** (정답 문서 top-10 포함률).
- **SpectRAG**는 100,000 문서에서 300개 쿼리를 0.6–1.1초 내 처리 (평균 2–4ms/쿼리).
- **4×4 크로스 도메인 전이 실험**에서 11개 쌍은 HN@10 ∈ [0.44, 0.85], 1개 쌍은 HN@10 = 0.2957.
- **재작성된 쿼리에 대한 HitC@10 ≈ 0.79** (trap 제거 유지).
의의 및 한계
이 연구는 **실제 도메인에서 의미 반전 문서(trap)를 효과적으로 제거**하는 구조적 접근을 제시하며, **소형 투영과 경계 조건 기반 가속기**를 통해 실용적 성능을 달성했다. 특히, **4개 독립 도메인에서 동일한 코드 경로로 실험**한 점은 신뢰성을 높인다. 그러나 **재작성된 쿼리에 대한 HitC@10이 0.79로 하락**하며, **도메인 간 전이 성능이 제한적**이라는 한계가 있다. 또한, **확률적 경계 없이 선언된 케이스에만 적용**되므로 일반화 가능성은 제한적이다.
실용적 활용
이 연구는 **법률, 의료, 특허, 금융** 등 의미 오류가 운영 실패로 이어질 수 있는 분야에서 실용적이다. **소형 투영과 SpectRAG 가속기**를 통해 **90배 작고 빠른 인덱스**를 구축할 수 있어, **다수의 소규모 인덱스가 대규모 벡터 저장소 대안**이 될 수 있다.