Skill for AI agent capabilities
Scanned 9/11/2026
Install to Claude Code
npx -y skills add hiyenwong/ai_collection --skill llm-code-generation-survey --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Llm Code Generation Survey?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/hiyenwong-llm-code-generation-survey)More formats (shields.io, HTML) on the badges page.
---
name: llm-code-generation-survey
description: Skill for AI agent capabilities
---
# LLM Code Generation Survey
## Description
A comprehensive survey on Large Language Models for Code Generation, covering challenges, fine-tuning techniques, evaluation metrics, and applications. Enables users regardless of technical background to generate executable code from natural language descriptions.
**Key Topics:**
- LLM limitations and challenges in automated code generation
- Fine-tuning techniques for performance and adaptability
- Evaluation metrics and benchmarks (HumanEval, MBPP, BigCodeBench)
- Applications (CodeLlama, GitHub Copilot, ToolGen)
## Tools Used
- read: Load code contexts and specifications
- write: Generate code files
- exec: Run generated code and tests
- browser: Access code repositories
- memory_search: Retrieve coding patterns
## Instructions for Agents
### Code Generation Pipeline
1. **Understand Requirements** - Parse natural language specification
2. **Generate Code** - Use LLM to produce executable code
3. **Validate** - Test and verify generated code
4. **Refine** - Iterate based on feedback
### Key Challenges
- Code correctness and syntax errors
- Security vulnerabilities
- Performance optimization
- Cross-language translation
- Low-resource languages
## Overview
**Source:** arXiv:2503.01245v2
**Utility:** 0.92
**Scope:** Comprehensive survey of challenges, techniques, evaluation, and applications
## Activation Keywords
- LLM code generation
- code generation survey
- automated programming
- CodeLLM
- natural language to code
---
## Challenges in Code Generation
### Technical Challenges
| Challenge | Description | Solutions |
|-----------|-------------|-----------|
| Syntax Errors | Invalid code generation | AST-based validation |
| Semantic Errors | Logic bugs | Test-driven generation |
| Security | Vulnerable code | Security fine-tuning |
| Performance | Inefficient code | Performance benchmarks |
| Context | Missing dependencies | Context retrieval |
### Evaluation Benchmarks
| Benchmark | Description | Languages |
|-----------|-------------|-----------|
| HumanEval | Function completion | Python |
| MBPP | Basic programming | Python |
| BigCodeBench | Large-scale evaluation | Multi-language |
| APPS | Competition problems | Python |
| CodeContests | Programming contests | Multi-language |
---
## Fine-Tuning Techniques
### 1. Instruction Tuning
```python
class CodeInstructionTuner:
def __init__(self, base_model, code_instructions):
self.model = base_model
self.instructions = code_instructions
def finetune(self, epochs=3):
for epoch in range(epochs):
for instruction, code in self.instructions:
prompt = f"""
# Task: {instruction}
# Generate code:
"""
loss = self.train_step(prompt, code)
```
### 2. Reinforcement Learning from Human Feedback (RLHF)
```python
class CodeRLHF:
def __init__(self, model, reward_model):
self.model = model
self.reward_model = reward_model
def train(self, prompts):
for prompt in prompts:
# Generate multiple code samples
codes = self.model.generate(prompt, n=4)
# Get human preferences
rewards = self.reward_model.score(codes)
# Update policy
self.update_policy(codes, rewards)
```
### 3. Code-Specific Pretraining
```python
class CodePretrainer:
def __init__(self, model, code_corpus):
self.model = model
self.corpus = code_corpus
def pretrain(self):
for code_file in self.corpus:
# Next token prediction
loss = self.model.next_token(code_file)
# Fill-in-the-middle
masked = self.mask_code(code_file)
loss += self.model.fill_middle(masked)
```
---
## Evaluation Metrics
### Functional Correctness
```python
def pass_at_k(predictions, test_cases, k=1):
"""
Calculate pass@k metric
k: number of attempts allowed
"""
for i in range(k):
code = predictions[i]
if all(execute(code, test) for test in test_cases):
return 1
return 0
```
### Code Quality Metrics
| Metric | Description | Measurement |
|--------|-------------|-------------|
| Correctness | Functional accuracy | pass@k |
| Readability | Code clarity | Style linters |
| Efficiency | Runtime performance | Benchmark execution |
| Security | Vulnerability count | Static analysis |
---
## Model Architectures
### Encoder-Decoder (CodeT5)
```python
class CodeT5(nn.Module):
def __init__(self, encoder, decoder):
self.encoder = encoder
self.decoder = decoder
def forward(self, nl_description):
# Encode natural language
encoded = self.encoder(nl_description)
# Decode to code
code = self.decoder(encoded)
return code
```
### Decoder-Only (CodeLlama)
```python
class CodeLlama(nn.Module):
def __init__(self, transformer):
self.transformer = transformer
def generate(self, prompt, max_tokens=512):
tokens = self.tokenize(prompt)
for _ in range(max_tokens):
logits = self.transformer(tokens)
next_token = self.sample(logits)
tokens.append(next_token)
if next_token == EOS:
break
return self.detokenize(tokens)
```
---
## Representative Models
| Model | Size | Training Data | Speciality |
|-------|------|---------------|------------|
| CodeLlama | 7B-34B | 500B tokens | Multi-language |
| StarCoder | 15B | 1T tokens | Permissive license |
| CodeGen | 2B-16B | CODEGEN-NL | Conversation |
| DeepSeek-Coder | 1.3B-33B | 2T tokens | Code completion |
| CodeT5+ | 220M-16B | CodeSearchNet | Understanding + Generation |
---
## Applications
### 1. Code Completion
```python
def complete_code(model, prefix, max_new_tokens=100):
prompt = f"# Context:\n{prefix}\n# Complete:\n"
completion = model.generate(prompt, max_new_tokens)
return completion
```
### 2. Code Translation
```python
def translate_code(model, source_code, source_lang, target_lang):
prompt = f"""
# Translate from {source_lang} to {target_lang}:
```{source_lang}
{source_code}
```
"""
translated = model.generate(prompt)
return translated
```
### 3. Code Summarization
```python
def summarize_code(model, code):
prompt = f"""
# Generate a brief summary:
```
{code}
```
Summary:
"""
summary = model.generate(prompt, max_tokens=100)
return summary
```
### 4. Bug Fixing
```python
def fix_bug(model, buggy_code, error_message):
prompt = f"""
# Buggy code:
```
{buggy_code}
```
# Error: {error_message}
# Fixed code:
"""
fixed = model.generate(prompt)
return fixed
```
---
## Best Practices
1. **Prompt Engineering** - Clear, specific instructions
2. **Context Provision** - Include relevant libraries/APIs
3. **Iterative Refinement** - Test and improve
4. **Security Review** - Audit generated code
5. **Human Oversight** - Validate critical code
---
## Tools Integration
| Tool | Integration | Use Case |
|------|-------------|----------|
| GitHub Copilot | IDE plugin | Real-time completion |
| Codeium | Multi-IDE | Free alternative |
| Amazon CodeWhisperer | AWS integration | Cloud development |
| Tabnine | Enterprise | On-premise deployment |
---
## Examples
### Example 1: Basic Application
**User:** I need to apply LLM Code Generation Survey to my analysis.
**Agent:** I'll help you apply llm-code-generation-survey. First, let me understand your specific use case...
**Context:** Code Completion
### Example 2: Advanced Scenario
**User:** Complex analysis scenario
**Agent:** Based on the methodology, I'll guide you through the advanced application...
### Example 2: Advanced Application
**User:** What are the key considerations for llm-code-generation-survey?
**Agent:** Let me search for the latest research and best practices...
## References
- Paper: https://arxiv.org/abs/2503.01245
- DOI: https://doi.org/10.48550/arXiv.2503.01245
- GitHub: https://github.com/juyongjiang/CodeLLMSurvey
---
**Created:** 2026-03-28
**Source:** arXiv:2503.01245v2 - "LLMs for Code Generation: A Comprehensive Survey"Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!