모바일 개발을 위한 LLM 선택 프레임워크: Test-Driven Prompt Engineering의 Android/iOS 적용
Large Language Model Selection for Test-Driven Prompt Android iOS Development
TL;DR Highlight
LLM 코드 생성 모델의 Python 편향을 Android(Java)/iOS(Swift)로 확장하여 각 플랫폼별 최적 모델 선택 기준을 결정 트리로 정리했다.
Who Should Read
모바일 앱 개발에 AI 코드 생성을 도입하려는 Android/iOS 개발자나 팀. GPT-4o vs 오픈소스 모델 선택 기준이 필요한 상황에 특히 유용하다.
Core Mechanics
- HumanEval·MBPP 기준 8,704회 평가 — GPT-4o, GPT-4o-mini, Qwen 14B, Qwen 32B 4개 모델을 Android(Java)·iOS(Swift)에서 직접 비교
- TDP(Test-Driven Prompting, 테스트 케이스를 프롬프트에 넣어 정답을 유도하는 기법)가 기본 프롬프트 대비 평균 +2.22 pp 정확도 향상
- 모바일 플랫폼 정확도는 66.85%~88.87%로, Python 코드 생성(86.90%~91.30%)보다 일관되게 낮음 — 모델 크기와 무관
- 첫 시도 정확도, 예산 제약, 자체 호스팅 여부를 기준으로 모델을 고르는 결정 트리 제공
- Remediation Accuracy(틀린 코드를 재시도로 고치는 비율)도 함께 측정해, 실무 워크플로우에 가까운 평가
Evidence
- TDP vs 기본 프롬프트: 평균 +2.22 pp (95% CI [1.22–3.23 pp], p < 0.001, Cohen's d = 0.3974)
- 모바일 최고 정확도 88.87% — Python 최저(86.90%)와 비슷하거나 낮은 수준
- 544개 프로그래밍 태스크 × 4개 모델 × 2개 플랫폼 × 2개 전략 = 8,704회 평가
How to Apply
- 코드 생성 프롬프트에 함수 시그니처와 함께 예상 입출력 테스트 케이스를 포함시키면(TDP), 약 2 pp 정확도 향상을 기대할 수 있다.
- 비용이 중요하다면 GPT-4o 대신 Qwen 32B 자체 호스팅을 검토하고, 첫 시도 정확도가 낮은 태스크에는 Remediation(재시도) 루프를 붙여라.
- 모바일 코드 생성은 Python보다 품질이 떨어지므로, CI에 유닛 테스트 자동 실행을 연결해 LLM 출력을 무조건 검증하는 파이프라인을 구성하라.
Code Example
# Test-Driven Prompting 예시 (Swift 함수 생성)
prompt = """
Write a Swift function that reverses a string.
Requirements:
- Function signature: func reverseString(_ s: String) -> String
Test cases (your output must pass all of these):
- reverseString("hello") == "olleh"
- reverseString("") == ""
- reverseString("a") == "a"
- reverseString("Swift") == "tfiwS"
Return only the function implementation.
"""
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": prompt}]
)Terminology
관련 논문
Claude Code에서 HTML을 출력 포맷으로 쓰는 이유: Markdown보다 나은 점들
Claude Code 팀이 Markdown 대신 HTML을 LLM 출력 포맷으로 선호하기 시작한 이유와 그 실용적 장점을 정리한 글로, AI와 함께 문서/스펙/대시보드를 만드는 워크플로우에 직접적인 영향을 준다.
언제 투표하고 언제 다시 쓸까: Disagreement 기반 Test-Time Scaling 전략 라우팅
모델 출력이 얼마나 일치하는지 보고 쉬운 문제엔 majority voting, 어려운 문제엔 문제 rewriting을 자동으로 선택해 정확도 3~7% 올리고 샘플링 비용도 줄이는 학습 불필요 프레임워크.
Less Is More: Android 앱에 On-Device Small Language Model 통합할 때 실제로 겪는 엔지니어링 문제들
Wordle 게임에 온디바이스 SLM(Gemma 4 E2B, Qwen3 0.6B)을 5일간 붙여보면서 발견한 5가지 실패 유형과 8가지 실용 해결책 정리
확장 가능한 Synthetic Data 생성을 위한 Dynamic Context Evolution
VTS + Semantic Memory + Adaptive Prompt 3가지 메커니즘으로 구성된 프레임워크는 LLM 대량 synthetic data 생성 시 배치 간 중복·반복 현상을 완전히 제거한다.
Karpathy 워크플로우에서 영감받아 사전 컴파일된 Wiki로 세션당 토큰 90%+ 절감
사전에 정리된 코드베이스 Wiki를 활용하면 Claude 세션당 토큰 사용량을 90% 이상 줄인다.
3개월치 AI 생성 코드를 전부 삭제했다. 그리고 배운 것들.
AI로 작성된 코드베이스를 70% 삭제 후 2주 만에 재작성하니 절반 크기로 줄어들면서 완전한 이해 가능성을 확보했다.
Original Abstract (Expand)
Large language model (LLM) code generation research predominantly focuses on Python, with test-driven prompt engineering exclusively targeting this language. This study presents a comprehensive LLM selection framework for mobile development through rigorous empirical analysis. We conducted 8,704 evaluations across 544 programming tasks (HumanEval and MBPP datasets) on Android (Java) and iOS (Swift) platforms using four state-of-the-art LLMs (GPT-4o, GPT-4o-mini, Qwen 14B, and Qwen 32B), two prompting strategies (base and test-driven), and two metrics (accuracy and remediation accuracy). Systematic analysis of platform-specific patterns yielded a decision tree incorporating first-attempt correctness, budget constraints, and self-hosting requirements, validated through three industry-relevant use cases. Results show test-driven prompting (TDP) achieves a +2.22 pp average accuracy improvement over baseline (95% CI [1.22–3.23 pp], p < 0.001, d = 0.3974). However, LLMs consistently underperform in mobile development (66.85%–88.87%) compared to Pythonbased code generation (86.90%–91.30%) regardless of model size or type. This framework establishes groundwork for platform-specific optimizations while providing practitioners with actionable guidance for model selection in mobile development contexts.