추상 구문 트리 기반 구조 인지형 검색증강생성을 활용한 수학 단답형 자동채점
AST-Based Structure-Aware RAG for Automated Mathematical Short-Answer
- 주제(키워드) LLM , RAG , 검색증강생성 , AST , 추상구문트리 , CAS
- 발행기관 서강대학교 AI.SW대학원
- 지도교수 김영재
- 발행년도 2026
- 학위수여년월 2026. 2
- 학위명 석사
- 학과 및 전공 AI.SW대학원 데이터사이언스 · 인공지능
- 실제URI http://www.dcollection.net/handler/sogang/000000082324
- UCI I804:11029-000000082324
- 본문언어 한국어
- 저작권 논문은 저작권에 의해 보호받습니다.
초록(요약문)
Recent advances in Large Language Models (LLMs) have led to widespread adoption of automated grading systems in both public and private education sectors. However, in mathematical short-answer assessments, grading errors due to insufficient recognition of mathematical expression structures remain frequent. For instance, systems often fail to recognize the equivalence between a student answer (x-1)(x+1) and the correct answer x²-1, or treat √12 and 2√3 as different answers despite their mathematical equivalence. Such errors not only undermine the fairness and reliability of grading but also degrade the quality of AI-generated learning feedback. To address these challenges, this study proposes SymbolicRAG, a framework that integrates Abstract Syntax Tree (AST)- based structure-aware retrieval with Computer Algebra System (CAS) symbolic verification. The proposed system (1) performs initial embedding-based retrieval followed by re-ranking using AST structural similarity and grade/unit metadata to prioritize structurally similar solutions, (2) employs SymPy-based two-stage symbolic verification (algebraic and numerical) to deterministically assess mathematical equivalence between student answers and correct solutions, and (3) incorporates verification results and similar solutions into prompts to enable LLMs to generate explainable grading rationales and feedback. Experimental evaluation on 312 test cases (104 questions × 3 answer types: standard correct, structurally transformed correct, and incorrect answers) based on Korean middle and high school mathematics curricula demonstrates that SymbolicRAG achieves 5.3%p improvement in Accuracy and 15.2%p improvement in Structural Equivalence Recognition (SER) compared to Non-RAG baseline. Specifically, SymbolicRAG records Accuracy 0.987, Precision 1.000, Recall 0.981, F1-score 0.990, and SER 0.981, outperforming both standalone LLM-based grading and embedding-based General RAG. Notably, while General RAG shows lower performance (0.893) than Non-RAG (0.934) due to failure in capturing structural equivalence, SymbolicRAG successfully demonstrates the effectiveness of RAG in mathematical domains through structure aware retrieval. This research presents a practical methodology that simultaneously ensures accuracy and explainability by combining symbolic verification with structure-aware retrieval in mathematical automated grading. It contributes to establishing explainable AI-based assessment systems required by the Ministry of Education's AI Digital Textbook policy and provides a technical foundation for reliably deploying mathematical automated grading systems in actual public education environments.
more초록(요약문)
최근 대규모 언어모델(Large Language Model, LLM)을 활용한 자동채점 기술이 공교육 및 사교육 현장에 빠르게 확산되고 있으나, 수학 단답형 평가에서는 수식 구조 인식 부족으로 인한 채점 오류가 여전히 빈번하게 발생한다. 예를 들어 학생 답안이 (x- 1)(x+1)일 때 정답 x²-1과의 동치성을 인식하지 못하거나, √12 와 2√3 이 수학적으로 동일함에도 서로 다른 답으로 처리하는 문제가 대표적이다. 이러한 오류는 채점의 공정성과 신뢰성을 저해할 뿐만 아니라, AI 자동채점 결과에 기반한 학습 피드백의 질을 저하시키는 요인으로 작용한다.본 연구는 이러한 문제를 해결하기 위하여 추상 구문 트리(Abstract Syntax Tree, AST) 기반 구조 인지형 검색과 컴퓨터 대수 시스템(Computer Algebra System, CAS) 심볼릭 검증을 통합한 SymbolicRAG 프레임워크를 제안한다. 제안 시스템은 (1) 임베딩 기반 초기 검색 후 AST 구조 유사도와 학년·단원 메타데이터를 결합한 재순위화로 구조적으로 유사한 풀이를 우선 검색하고, (2) SymPy 를 활용한 2 단계 심볼릭 검증(대수적 검증 및 수치적 검증)을 통해 학생 답안과 정답의 수학적 동치성을 결정론적으로 판별하며, (3) 검증 결과와 유사 풀이를 프롬프트에 반영하여 LLM 이 설명 가능한 채점 근거와 피드백을 생성하도록 설계하였다.국내 중·고등학교 수학 교육과정을 기반으로 구성한 문항에 대해 각 3 가지 답안 유형(표준 정답, 구조 변형 정답, 오답)을 구성한 총 312 개 테스트 케이스로 실험한 결과, SymbolicRAG 는 Non-RAG 대비 채점 정확도(Accuracy) 5.3%p, 구조 변형 정답 인식률(Structural Equivalence Recognition, SER) 15.2%p 향상을 달성하였다. 특히 SymbolicRAG 는 Accuracy 0.987, Precision 1.000, Recall 0.981, F1-score 0.990, SER 0.981 을 기록하여, 단순 LLM 기반 채점과 임베딩 기반 일반 RAG 를 모두 상회하는 성능을 보였다. 주목할 점은 임베딩 기반 일반 RAG 가 수식의 구조적 동치성을 포착하지 못해 Non-RAG(Accuracy 0.934)보다 오히려 낮은 성능(0.893)을 보인 반면, SymbolicRAG 는 구조 인지형 검색을 통해 수학 영역에서 RAG 의 효과를 실증하였다는 것이다. 본 연구는 수학 자동채점에서 심볼릭 검증과 구조 인지형 검색을 결합한 하이브리드 접근을 제시함으로써, 정확성과 설명 가능성을 동시에 확보할 수 있는 실용적 방법론을 제공한다. 이는 교육부의 AI 디지털교과서 정책에서 요구하는 설명 가능한 AI 기반 평가 체제 구축에 기여할 수 있으며, 실제 공교육 환경에서 수학 자동채점 시스템을 신뢰성 있게 도입하기 위한 기술적 기반을 마련한다.
more목차
제 1 장 서론 1
제 1 절 연구의 배경 및 필요성 1
제 2 절 연구의 목적 4
제 3 절 연구 범위 및 구성 5
제 2 장 선행 연구 7
제 1 절 자동 단답형 채점 연구 7
제 2 절 검색증강생성(RAG) 기반 채점 연구 8
제 3 절 본 연구의 차별점 9
제 3 장 제안 방법 10
제 1 절 SymbolicRAG 프레임워크 개요 10
제 2 절 컴퓨터 대수 시스템(CAS) 11
제 3 절 AST 기반 구조 인지형 재순위화 15
제 4 절 심볼릭 검증 기반 정답 판별 18
제 5 절 LLM 기반 최종 채점 및 피드백 생성 20
제 4 장 실험 설계 24
제 1 절 실험 환경 24
제 2 절 비교 조건 27
제 3 절 평가 지표 31
제 5 장 실험 결과 36
제 1 절 전체 채점 성능 비교 36
제 2 절 답안 유형별 인식 성능 38
제 3 절 학년별 및 단원별 성능 분석 39
제 4 절 메타데이터 영향 분석 41
제 6 장 결론 43
제 1 절 General RAG 성능 저하의 원인 분석 43
제 2 절 연구 성과 및 의의 43
제 3 절 한계 및 향후 연구 방향 44
참고 문헌 46

