data-efficient multi-label retrieval-models legal-annotation hallucination-free k-nearest-neighbors eurlex ecthr-a
Abstract
Multi-label legal annotation requires assigning multiple labels from large, evolving taxonomies to long, fact-intensive documents, often under limited supervision. Parametric encoders typically require task-specific training and retraining when the label set changes, while prompting generative large language models becomes costly and degrades as the label space grows. We cast legal annotation as retrieval: we embed documents and label descriptions with a frozen retrieval model and predict labels via k-nearest neighbors in the embedding space, enabling updates by re-embedding and re-indexing rather than gradient-based backpropagation. Across three legal datasets (ECtHR-A, ECtHR-B, and Eurlex with 100 labels), retrieval achieves competitive accuracy and strong data efficiency; on Eurlex, Qwen-8B retrieval improves Macro-F1 from 40.41 (GPT-5.2, zero-shot) to 49.12 while reducing estimated compute by 20-30 times compared to fine-tuning. With only (N=100) training samples, retrieval nearly doubles Micro-F1 over hierarchical Legal-BERT on ECtHR-A (48.29 vs. 27.87). We also quantify a reliability failure mode of generative inference: GPT-5.2 hallucinates labels outside the provided taxonomy in 0.12-0.9% of test samples under deterministic decoding. In contrast, retrieval strictly respects defined label sets, eliminating hallucination by design. These results suggest retrieval-model-based annotators are a practical, deployable alternative for high-cardinality and rapidly changing legal label spaces.
한국어 요약
📋 한 줄 요약
**[법률 NLP]** 법률 문서의 다중 라벨 주석 문제를 retrieval로 재정의하여 환각 없이, 라벨 변경에도 재학습 없이 동작하는 데이터 효율적 시스템을 제안했다.
🎯 핵심 기여도
- 다중 라벨 법률 주석을 분류가 아닌 retrieval 문제로 캐스팅하는 패러다임 제시
- 프리즌(frozen) retrieval 모델만으로 그래디언트 학습 없이 라벨 갱신·확장 가능
- 생성형 LLM의 라벨 환각 문제를 정량화하고 retrieval 방식으로 원천 차단
- 작은 학습 샘플 환경에서 hierarchical Legal-BERT 대비 큰 폭의 성능 향상 입증
💡 핵심 아이디어
법률 라벨 체계는 크고 자주 바뀌며 문서는 길고 사실 중심이다. 파라미터 인코더는 라벨 변경 시 재학습이 필요하고, 생성형 LLM은 라벨 공간이 커질수록 비용·환각이 증가한다. 문서와 라벨 설명을 같은 임베딩 공간에 두고 kNN으로 라벨을 예측하면, 라벨 변경은 단순한 재임베딩·재인덱싱으로 처리되며 정의된 라벨 집합 외부로의 환각이 구조적으로 불가능해진다.
🔬 기술적 접근법
- Frozen retrieval encoder로 문서·라벨 설명 임베딩
- 임베딩 공간에서 k-nearest neighbor 검색으로 다중 라벨 할당
- 라벨 갱신 시 학습 없이 재임베딩만 수행
- 결정론적 디코딩 환경에서 GPT-5.2의 라벨 환각률 측정
📊 주요 결과
- Eurlex(100 라벨): Qwen-8B retrieval Macro-F1 49.12 (GPT-5.2 zero-shot 40.41 대비 향상), fine-tuning 대비 추정 컴퓨트 20–30배 절감
- ECtHR-A: 100 샘플 학습 시 retrieval Micro-F1 48.29 vs hierarchical Legal-BERT 27.87
- GPT-5.2는 결정론적 디코딩에서 0.12–0.9%의 라벨 환각 발생, retrieval은 0%
💭 의의 및 한계
환각이 곧 법적 리스크인 도메인에서 "정의된 라벨만 보장"이라는 강한 안전 속성을 설계 수준에서 확보한 점이 중요하다. retrieval 모델 품질에 성능이 의존하며, ECtHR/Eurlex 외 다른 법체계·언어로의 일반화 검증은 더 필요하다.
🚀 실용적 활용
판례 분류, 규제 태깅, 계약 조항 매핑 등 라벨 체계가 크고 자주 바뀌는 법률·규제·컴플라이언스 워크플로에서 운영 가능한 대안으로, 사내 KMS·legal-tech 솔루션의 핵심 분류 엔진으로 배포할 수 있다.