Skip to content

개선: S8 LLM Ablation 속도 최적화 — 77 corpus에 65분은 비현실적 #3

@SonAIengine

Description

@SonAIengine

현황

  • PublicHealthQA (77 corpus) S0~S8 ablation: 65분 소요
  • S7 Auto+Embed: embedding 호출 77회 + relation detection O(n²)
  • S8 LLM Full: LLM classify 75회 개별 호출 (27B BF16, ~50초/건)
  • 13종 전체 × 9단계 = 비현실적 실행 시간

병목 분석

  1. S7 Embedding: 문서별 Ollama embedding 호출 (각 ~0.5초) + relation_detector가 O(n²) 후보 검색
  2. S8 LLM classify: thinking 모델(Qwen3.5-27B)이 2048 토큰 thinking 후 응답 → 건당 50초
  3. S8 batch 분류: batch max_tokens가 thinking으로 폭증 (16개 batch → 32K 토큰)

TODO

  • Embedding batch 호출 — 현재 문서별 1회 → N개 묶어서 한 번에
  • RelationDetector 후보 탐색 최적화 — InvertedIndex만 사용, vector search 비활성화 옵션
  • LLM classify batch 최적화 — thinking 모델용 max_tokens 제한
  • /no_think 지원 서버 사용 시 자동 감지
  • S7/S8을 pytest marker로 분리 (@pytest.mark.slow) → 선택적 실행
  • 데이터셋별 corpus 제한 (MAX_DOCS) S8 전용 설정

단기 해결

# S0~S6만 빠르게 (5분)
uv run pytest tests/benchmark/test_ablation.py -v -s -k "not fiqa"

# S8 LLM은 소규모만
uv run pytest tests/benchmark/test_ablation.py -v -s -k "publichealthqa or xpqa"

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions