코드로 학습된 대규모 언어 모델 평가
Evaluating Large Language Models Trained on Code
우리는 GitHub에서 공개적으로 사용 가능한 코드로 미세 조정된 GPT 언어 모델인 Codex를 소개하고, 이 모델의 파이썬 코드 작성 능력을 연구한다. Codex의 별도 상용 버전은 GitHub Copilot을 구동한다. 독스트링(docstring)으로부터 프로그램을 합성하는 기능적 정확성을 측정하기 위해 우리가 공개한 새로운 평가 세트인 HumanEval에서, 우리 모델은 28.8%의 문제를 해결한 반면 GPT-3는 0%, GPT-J는 11.4%를 해결했다. 더 나아가, 우리는 모델에서 반복적으로 샘플링을 수행하는 것이 어려운 프롬프트에 대해 작동하는 솔루션을 생성하는 데 놀랍도록 효과적인 전략임을 발견했다. 이 방법을 사용하여 우리는 문제당 100개의 샘플로 70.2%의 문제를 해결했다. 모델을 면밀히 조사한 결과, 긴 연산 사슬을 설명하는 독스트링 처리와 변수에 연산을 바인딩하는 데 있어서의 어려움을 포함한 한계점이 드러났다. 마지막으로 우리는 안전, 보안 및 경제적 측면을 다루며 강력한 코드 생성 기술 배포가 가져올 잠재적이고 광범위한 영향에 대해 논의한다.
We introduce Codex, a GPT language model fine-tuned on publicly available code from GitHub, and study its Python code-writing capabilities. A distinct production version of Codex powers GitHub Copilot. On HumanEval, a new evaluation set we release to measure functional correctness for synthesizing programs from docstrings, our model solves 28.8% of the problems, while GPT-3 solves 0% and GPT-J solves 11.4%. Furthermore, we find that repeated sampling from the model is a surprisingly effective strategy for producing working solutions to difficult prompts. Using this method, we solve 70.2% of our problems with 100 samples per problem. Careful investigation of our model reveals its limitations, including difficulty with docstrings describing long chains of operations and with binding operations to variables. Finally, we discuss the potential broader impacts of deploying powerful code generation technologies, covering safety, security, and economics.
AI Analysis
Korean Summary
Key Innovations
- 코드 생성 능력을 평가하기 위한 새로운 벤치마크 데이터셋 'HumanEval' 공개
- 단순 텍스트 매칭이 아닌 단위 테스트 통과 여부를 기반으로 하는 'pass@k' 평가 지표 및 비편향 추정량(unbiased estimator) 도입
- 독립형 함수(Standalone functions) 데이터를 활용한 지도 파인튜닝(Supervised Fine-tuning) 모델 'Codex-S' 개발
- 코드의 공백(whitespace) 특성을 반영하여 토큰 효율성을 30% 높인 확장된 토크나이저 적용
- 생성된 코드의 안전한 실행 및 평가를 위한 샌드박스(Sandbox) 환경 구축
Learning & Inference Impact
학습 측면에서는 자연어 모델인 GPT-3를 기반으로 하되, 방대한 GitHub 코드 데이터로 파인튜닝하여 프로그래밍 언어의 구조적 특성을 학습시켰습니다. 특히 공백 처리를 위한 토큰을 추가하여 학습 및 추론 속도를 최적화했습니다. 추론 측면에서는 '반복 샘플링(Repeated Sampling)' 전략의 유효성을 입증했는데, 단일 결과만 생성하는 것보다 높은 온도(temperature)로 100개의 샘플을 생성한 뒤 단위 테스트를 통과하는 코드를 찾는 방식이 성능(pass rate)을 28.8%에서 70.2%까지 끌어올릴 수 있음을 보여주었습니다. 이는 추론 비용을 늘리더라도 정확한 코드를 얻는 실용적인 접근법을 제시합니다.
Technical Difficulty
Estimated implementation complexity based on methodology.