# SkillPatch skill: huggingface-paper-publisher

This skill enables AI engineers and researchers to publish and manage research papers on the Hugging Face Hub. It supports indexing papers from arXiv, linking papers to models and datasets, claiming authorship, and generating professional markdown-based research articles. The skill includes Python scripts and detailed CLI usage instructions for streamlined paper management workflows.

You (the agent) were given this URL and asked to use this skill. This is a **public** skill — no SkillPatch account, API key, or prior setup is required. Two ways to use it:

**1. Use it right now** — the skill's complete file tree (SKILL.md + all reference files) is inlined below; read `SKILL.md` first, then follow it, consulting the other files as it directs.

**2. Install the exact package onto disk** (recommended if you can run a shell — this reproduces the skill byte-for-byte, including any binary assets that can't be inlined):

```bash
mkdir -p .claude/skills/huggingface-paper-publisher
curl -sSL https://skillpatch.dev/install_skill/huggingface-paper-publisher | tar -xz -C .claude/skills/
```

(`.claude/skills/` is Claude Code's convention; use whatever directory your agent loads skills from.)


---

## Skill files (8)

- `SKILL.md`
- `examples/example_usage.md`
- `references/quick_reference.md`
- `scripts/paper_manager.py`
- `templates/arxiv.md`
- `templates/ml-report.md`
- `templates/modern.md`
- `templates/standard.md`


### `SKILL.md`

````markdown
---
name: huggingface-paper-publisher
description: Publish and manage research papers on Hugging Face Hub. Supports creating paper pages, linking papers to models/datasets, claiming authorship, and generating professional markdown-based research articles.
---

# Overview
This skill provides comprehensive tools for AI engineers and researchers to publish, manage, and link research papers on the Hugging Face Hub. It streamlines the workflow from paper creation to publication, including integration with arXiv, model/dataset linking, and authorship management.

## Integration with HF Ecosystem
- **Paper Pages**: Index and discover papers on Hugging Face Hub
- **arXiv Integration**: Automatic paper indexing from arXiv IDs
- **Model/Dataset Linking**: Connect papers to relevant artifacts through metadata
- **Authorship Verification**: Claim and verify paper authorship
- **Research Article Template**: Generate professional, modern scientific papers

# Version
1.0.0

# Dependencies
The included script uses PEP 723 inline dependencies. Prefer `uv run` over
manual environment setup.

- huggingface_hub>=0.26.0
- pyyaml>=6.0.3
- requests>=2.32.5
- markdown>=3.5.0
- python-dotenv>=1.2.1

# Core Capabilities

## 1. Paper Page Management
- **Index Papers**: Add papers to Hugging Face from arXiv
- **Claim Authorship**: Verify and claim authorship on published papers
- **Manage Visibility**: Control which papers appear on your profile
- **Paper Discovery**: Find and explore papers in the HF ecosystem

## 2. Link Papers to Artifacts
- **Model Cards**: Add paper citations to model metadata
- **Dataset Cards**: Link papers to datasets via README
- **Automatic Tagging**: Hub auto-generates arxiv:<PAPER_ID> tags
- **Citation Management**: Maintain proper attribution and references

## 3. Research Article Creation
- **Markdown Templates**: Generate professional paper formatting
- **Modern Design**: Clean, readable research article layouts
- **Dynamic TOC**: Automatic table of contents generation
- **Section Structure**: Standard scientific paper organization
- **LaTeX Math**: Support for equations and technical notation

## 4. Metadata Management
- **YAML Frontmatter**: Proper model/dataset card metadata
- **Citation Tracking**: Maintain paper references across repositories
- **Version Control**: Track paper updates and revisions
- **Multi-Paper Support**: Link multiple papers to single artifacts

# Usage Instructions

The skill includes Python scripts in `scripts/` for paper publishing operations.

### Prerequisites
- Run scripts with `uv run` (dependencies are resolved from the script header)
- Set `HF_TOKEN` environment variable with Write-access token

> **All paths are relative to the directory containing this SKILL.md
file.**
> Before running any script, first `cd` to that directory or use the full
path.


### Method 1: Index Paper from arXiv

Add a paper to Hugging Face Paper Pages from arXiv.

**Basic Usage:**
```bash
uv run scripts/paper_manager.py index \
  --arxiv-id "2301.12345"
```

**Check If Paper Exists:**
```bash
uv run scripts/paper_manager.py check \
  --arxiv-id "2301.12345"
```

**Direct URL Access:**
You can also visit `https://huggingface.co/papers/{arxiv-id}` directly to index a paper.

### Method 2: Link Paper to Model/Dataset

Add paper references to model or dataset README with proper YAML metadata.

**Add to Model Card:**
```bash
uv run scripts/paper_manager.py link \
  --repo-id "username/model-name" \
  --repo-type "model" \
  --arxiv-id "2301.12345"
```

**Add to Dataset Card:**
```bash
uv run scripts/paper_manager.py link \
  --repo-id "username/dataset-name" \
  --repo-type "dataset" \
  --arxiv-id "2301.12345"
```

**Add Multiple Papers:**
```bash
uv run scripts/paper_manager.py link \
  --repo-id "username/model-name" \
  --repo-type "model" \
  --arxiv-ids "2301.12345,2302.67890,2303.11111"
```

**With Custom Citation:**
```bash
uv run scripts/paper_manager.py link \
  --repo-id "username/model-name" \
  --repo-type "model" \
  --arxiv-id "2301.12345" \
  --citation "$(cat citation.txt)"
```

#### How Linking Works

When you add an arXiv paper link to a model or dataset README:
1. The Hub extracts the arXiv ID from the link
2. A tag `arxiv:<PAPER_ID>` is automatically added to the repository
3. Users can click the tag to view the Paper Page
4. The Paper Page shows all models/datasets citing this paper
5. Papers are discoverable through filters and search

### Method 3: Claim Authorship

Verify your authorship on papers published on Hugging Face.

**Start Claim Process:**
```bash
uv run scripts/paper_manager.py claim \
  --arxiv-id "2301.12345" \
  --email "your.email@institution.edu"
```

**Manual Process:**
1. Navigate to your paper's page: `https://huggingface.co/papers/{arxiv-id}`
2. Find your name in the author list
3. Click your name and select "Claim authorship"
4. Wait for admin team verification

**Check Authorship Status:**
```bash
uv run scripts/paper_manager.py check-authorship \
  --arxiv-id "2301.12345"
```

### Method 4: Manage Paper Visibility

Control which verified papers appear on your public profile.

**List Your Papers:**
```bash
uv run scripts/paper_manager.py list-my-papers
```

**Toggle Visibility:**
```bash
uv run scripts/paper_manager.py toggle-visibility \
  --arxiv-id "2301.12345" \
  --show true
```

**Manage in Settings:**
Navigate to your account settings → Papers section to toggle "Show on profile" for each paper.

### Method 5: Create Research Article

Generate a professional markdown-based research paper using modern templates.

**Create from Template:**
```bash
uv run scripts/paper_manager.py create \
  --template "standard" \
  --title "Your Paper Title" \
  --output "paper.md"
```

**Available Templates:**
- `standard` - Traditional scientific paper structure
- `modern` - Clean, web-friendly format inspired by Distill
- `arxiv` - arXiv-style formatting
- `ml-report` - Machine learning experiment report

**Generate Complete Paper:**
```bash
uv run scripts/paper_manager.py create \
  --template "modern" \
  --title "Fine-Tuning Large Language Models with LoRA" \
  --authors "Jane Doe, John Smith" \
  --abstract "$(cat abstract.txt)" \
  --output "paper.md"
```

**Convert to HTML:**
```bash
uv run scripts/paper_manager.py convert \
  --input "paper.md" \
  --output "paper.html" \
  --style "modern"
```

### Paper Template Structure

**Standard Research Paper Sections:**
```markdown
---
title: Your Paper Title
authors: Jane Doe, John Smith
affiliations: University X, Lab Y
date: 2025-01-15
arxiv: 2301.12345
tags: [machine-learning, nlp, fine-tuning]
---

# Abstract
Brief summary of the paper...

# 1. Introduction
Background and motivation...

# 2. Related Work
Previous research and context...

# 3. Methodology
Approach and implementation...

# 4. Experiments
Setup, datasets, and procedures...

# 5. Results
Findings and analysis...

# 6. Discussion
Interpretation and implications...

# 7. Conclusion
Summary and future work...

# References
```

**Modern Template Features:**
- Dynamic table of contents
- Responsive design for web viewing
- Code syntax highlighting
- Interactive figures and charts
- Math equation rendering (LaTeX)
- Citation management
- Author affiliation linking

### Commands Reference

**Index Paper:**
```bash
uv run scripts/paper_manager.py index --arxiv-id "2301.12345"
```

**Link to Repository:**
```bash
uv run scripts/paper_manager.py link \
  --repo-id "username/repo-name" \
  --repo-type "model|dataset|space" \
  --arxiv-id "2301.12345" \
  [--citation "Full citation text"] \
  [--create-pr]
```

**Claim Authorship:**
```bash
uv run scripts/paper_manager.py claim \
  --arxiv-id "2301.12345" \
  --email "your.email@edu"
```

**Manage Visibility:**
```bash
uv run scripts/paper_manager.py toggle-visibility \
  --arxiv-id "2301.12345" \
  --show true|false
```

**Create Research Article:**
```bash
uv run scripts/paper_manager.py create \
  --template "standard|modern|arxiv|ml-report" \
  --title "Paper Title" \
  [--authors "Author1, Author2"] \
  [--abstract "Abstract text"] \
  [--output "filename.md"]
```

**Convert Markdown to HTML:**
```bash
uv run scripts/paper_manager.py convert \
  --input "paper.md" \
  --output "paper.html" \
  [--style "modern|classic"]
```

**Check Paper Status:**
```bash
uv run scripts/paper_manager.py check --arxiv-id "2301.12345"
```

**List Your Papers:**
```bash
uv run scripts/paper_manager.py list-my-papers
```

**Search Papers:**
```bash
uv run scripts/paper_manager.py search --query "transformer attention"
```

### YAML Metadata Format

When linking papers to models or datasets, proper YAML frontmatter is required:

**Model Card Example:**
```yaml
---
language:
  - en
license: apache-2.0
tags:
  - text-generation
  - transformers
  - llm
library_name: transformers
---

# Model Name

This model is based on the approach described in [Our Paper](https://arxiv.org/abs/2301.12345).

## Citation

```bibtex
@article{doe2023paper,
  title={Your Paper Title},
  author={Doe, Jane and Smith, John},
  journal={arXiv preprint arXiv:2301.12345},
  year={2023}
}
```
```

**Dataset Card Example:**
```yaml
---
language:
  - en
license: cc-by-4.0
task_categories:
  - text-generation
  - question-answering
size_categories:
  - 10K<n<100K
---

# Dataset Name

Dataset introduced in [Our Paper](https://arxiv.org/abs/2301.12345).

For more details, see the [paper page](https://huggingface.co/papers/2301.12345).
```

The Hub automatically extracts arXiv IDs from these links and creates `arxiv:2301.12345` tags.

### Integration Examples

**Workflow 1: Publish New Research**
```bash
# 1. Create research article
uv run scripts/paper_manager.py create \
  --template "modern" \
  --title "Novel Fine-Tuning Approach" \
  --output "paper.md"

# 2. Edit paper.md with your content

# 3. Submit to arXiv (external process)
# Upload to arxiv.org, get arXiv ID

# 4. Index on Hugging Face
uv run scripts/paper_manager.py index --arxiv-id "2301.12345"

# 5. Link to your model
uv run scripts/paper_manager.py link \
  --repo-id "your-username/your-model" \
  --repo-type "model" \
  --arxiv-id "2301.12345"

# 6. Claim authorship
uv run scripts/paper_manager.py claim \
  --arxiv-id "2301.12345" \
  --email "your.email@edu"
```

**Workflow 2: Link Existing Paper**
```bash
# 1. Check if paper exists
uv run scripts/paper_manager.py check --arxiv-id "2301.12345"

# 2. Index if needed
uv run scripts/paper_manager.py index --arxiv-id "2301.12345"

# 3. Link to multiple repositories
uv run scripts/paper_manager.py link \
  --repo-id "username/model-v1" \
  --repo-type "model" \
  --arxiv-id "2301.12345"

uv run scripts/paper_manager.py link \
  --repo-id "username/training-data" \
  --repo-type "dataset" \
  --arxiv-id "2301.12345"

uv run scripts/paper_manager.py link \
  --repo-id "username/demo-space" \
  --repo-type "space" \
  --arxiv-id "2301.12345"
```

**Workflow 3: Update Model with Paper Reference**
```bash
# 1. Get current README
hf download username/model-name README.md

# 2. Add paper link
uv run scripts/paper_manager.py link \
  --repo-id "username/model-name" \
  --repo-type "model" \
  --arxiv-id "2301.12345" \
  --citation "Full citation for the paper"

# The script will:
# - Add YAML metadata if missing
# - Insert arXiv link in README
# - Add formatted citation
# - Preserve existing content
```

### Best Practices

1. **Paper Indexing**
   - Index papers as soon as they're published on arXiv
   - Include full citation information in model/dataset cards
   - Use consistent paper references across related repositories

2. **Metadata Management**
   - Add YAML frontmatter to all model/dataset cards
   - Include proper licensing information
   - Tag with relevant task categories and domains

3. **Authorship**
   - Claim authorship on papers where you're listed as author
   - Use institutional email addresses for verification
   - Keep paper visibility settings updated

4. **Repository Linking**
   - Link papers to all relevant models, datasets, and Spaces
   - Include paper context in README descriptions
   - Add BibTeX citations for easy reference

5. **Research Articles**
   - Use templates consistently within projects
   - Include code and data links in papers
   - Generate web-friendly HTML versions for sharing

### Advanced Usage

**Batch Link Papers:**
```bash
# Link multiple papers to one repository
for arxiv_id in "2301.12345" "2302.67890" "2303.11111"; do
  uv run scripts/paper_manager.py link \
    --repo-id "username/model-name" \
    --repo-type "model" \
    --arxiv-id "$arxiv_id"
done
```

**Extract Paper Info:**
```bash
# Get paper metadata from arXiv
uv run scripts/paper_manager.py info \
  --arxiv-id "2301.12345" \
  --format "json"
```

**Generate Citation:**
```bash
# Create BibTeX citation
uv run scripts/paper_manager.py citation \
  --arxiv-id "2301.12345" \
  --format "bibtex"
```

**Validate Links:**
```bash
# Check all paper links in a repository
uv run scripts/paper_manager.py validate \
  --repo-id "username/model-name" \
  --repo-type "model"
```

### Error Handling

- **Paper Not Found**: arXiv ID doesn't exist or isn't indexed yet
- **Permission Denied**: HF_TOKEN lacks write access to repository
- **Invalid YAML**: Malformed metadata in README frontmatter
- **Authorship Failed**: Email doesn't match paper author records
- **Already Claimed**: Another user has claimed authorship
- **Rate Limiting**: Too many API requests in short time

### Troubleshooting

**Issue**: "Paper not found on Hugging Face"
- **Solution**: Visit `hf.co/papers/{arxiv-id}` to trigger indexing

**Issue**: "Authorship claim not verified"
- **Solution**: Wait for admin review or contact HF support with proof

**Issue**: "arXiv tag not appearing"
- **Solution**: Ensure README includes proper arXiv URL format

**Issue**: "Cannot link to repository"
- **Solution**: Verify HF_TOKEN has write permissions

**Issue**: "Template rendering errors"
- **Solution**: Check markdown syntax and YAML frontmatter format

### Resources and References

- **Hugging Face Paper Pages**: [hf.co/papers](https://huggingface.co/papers)
- **Model Cards Guide**: [hf.co/docs/hub/model-cards](https://huggingface.co/docs/hub/en/model-cards)
- **Dataset Cards Guide**: [hf.co/docs/hub/datasets-cards](https://huggingface.co/docs/hub/en/datasets-cards)
- **Research Article Template**: [tfrere/research-article-template](https://huggingface.co/spaces/tfrere/research-article-template)
- **arXiv Format Guide**: [arxiv.org/help/submit](https://arxiv.org/help/submit)

### Integration with tfrere's Research Template

This skill complements [tfrere's research article template](https://huggingface.co/spaces/tfrere/research-article-template) by providing:

- Automated paper indexing workflows
- Repository linking capabilities
- Metadata management tools
- Citation generation utilities

You can use tfrere's template for writing, then use this skill to publish and link the paper on Hugging Face Hub.

### Common Patterns

**Pattern 1: New Paper Publication**
```bash
# Write → Publish → Index → Link
uv run scripts/paper_manager.py create --template modern --output paper.md
# (Submit to arXiv)
uv run scripts/paper_manager.py index --arxiv-id "2301.12345"
uv run scripts/paper_manager.py link --repo-id "user/model" --arxiv-id "2301.12345"
```

**Pattern 2: Existing Paper Discovery**
```bash
# Search → Check → Link
uv run scripts/paper_manager.py search --query "transformers"
uv run scripts/paper_manager.py check --arxiv-id "2301.12345"
uv run scripts/paper_manager.py link --repo-id "user/model" --arxiv-id "2301.12345"
```

**Pattern 3: Author Portfolio Management**
```bash
# Claim → Verify → Organize
uv run scripts/paper_manager.py claim --arxiv-id "2301.12345"
uv run scripts/paper_manager.py list-my-papers
uv run scripts/paper_manager.py toggle-visibility --arxiv-id "2301.12345" --show true
```

### API Integration

**Python Script Example:**
```python
from scripts.paper_manager import PaperManager

pm = PaperManager(hf_token="your_token")

# Index paper
pm.index_paper("2301.12345")

# Link to model
pm.link_paper(
    repo_id="username/model",
    repo_type="model",
    arxiv_id="2301.12345",
    citation="Full citation text"
)

# Check status
status = pm.check_paper("2301.12345")
print(status)
```

### Future Enhancements

Planned features for future versions:
- Support for non-arXiv papers (conference proceedings, journals)
- Automatic citation formatting from DOI
- Paper comparison and versioning tools
- Collaborative paper writing features
- Integration with LaTeX workflows
- Automated figure and table extraction
- Paper metrics and impact tracking

````


### `examples/example_usage.md`

````markdown
# Example Usage: HF Paper Publisher Skill

This document demonstrates common workflows for publishing research papers on Hugging Face Hub.

## Example 1: Index an Existing arXiv Paper

If you've already published a paper on arXiv and want to make it discoverable on Hugging Face:

```bash
# Check if paper exists
uv run scripts/paper_manager.py check --arxiv-id "2301.12345"

# Index the paper
uv run scripts/paper_manager.py index --arxiv-id "2301.12345"

# Get paper information
uv run scripts/paper_manager.py info --arxiv-id "2301.12345"
```

Expected output:
```json
{
  "exists": true,
  "url": "https://huggingface.co/papers/2301.12345",
  "arxiv_id": "2301.12345",
  "arxiv_url": "https://arxiv.org/abs/2301.12345"
}
```

## Example 2: Link Paper to Your Model

After indexing a paper, link it to your model repository:

```bash
# Link single paper
uv run scripts/paper_manager.py link \
  --repo-id "username/my-awesome-model" \
  --repo-type "model" \
  --arxiv-id "2301.12345"

# Link multiple papers
uv run scripts/paper_manager.py link \
  --repo-id "username/my-awesome-model" \
  --repo-type "model" \
  --arxiv-ids "2301.12345,2302.67890"
```

This will:
1. Download the model's README.md
2. Add or update YAML frontmatter
3. Insert paper references with links
4. Upload the updated README
5. Hub automatically creates `arxiv:2301.12345` tags

## Example 3: Link Paper to Dataset

Same process for datasets:

```bash
uv run scripts/paper_manager.py link \
  --repo-id "username/my-dataset" \
  --repo-type "dataset" \
  --arxiv-id "2301.12345" \
  --citation "$(cat citation.bib)"
```

## Example 4: Create a New Research Article

Generate a research paper from template:

```bash
# Create with standard template
uv run scripts/paper_manager.py create \
  --template "standard" \
  --title "Efficient Fine-Tuning of Large Language Models" \
  --authors "Jane Doe, John Smith" \
  --abstract "We propose a novel approach to fine-tuning..." \
  --output "paper.md"

# Create with modern template
uv run scripts/paper_manager.py create \
  --template "modern" \
  --title "Vision Transformers for Medical Imaging" \
  --output "medical_vit_paper.md"

# Create ML experiment report
uv run scripts/paper_manager.py create \
  --template "ml-report" \
  --title "BERT Fine-tuning Experiment Results" \
  --output "bert_experiment_report.md"
```

## Example 5: Generate Citations

Get formatted citations for papers:

```bash
# BibTeX format
uv run scripts/paper_manager.py citation \
  --arxiv-id "2301.12345" \
  --format "bibtex"
```

Output:
```bibtex
@article{arxiv2301_12345,
  title={Efficient Fine-Tuning of Large Language Models},
  author={Doe, Jane and Smith, John},
  journal={arXiv preprint arXiv:2301.12345},
  year={2023}
}
```

## Example 6: Complete Workflow - New Paper

Full workflow from paper creation to publication:

```bash
# Step 1: Create research article
uv run scripts/paper_manager.py create \
  --template "modern" \
  --title "Novel Architecture for Multimodal Learning" \
  --authors "Alice Chen, Bob Kumar" \
  --output "multimodal_paper.md"

# Step 2: Edit the paper (use your favorite editor)
# vim multimodal_paper.md

# Step 3: Submit to arXiv (external process)
# Upload to arxiv.org, receive arXiv ID: 2312.99999

# Step 4: Index on Hugging Face
uv run scripts/paper_manager.py index --arxiv-id "2312.99999"

# Step 5: Link to your models/datasets
uv run scripts/paper_manager.py link \
  --repo-id "alice/multimodal-model-v1" \
  --repo-type "model" \
  --arxiv-id "2312.99999"

uv run scripts/paper_manager.py link \
  --repo-id "alice/multimodal-dataset" \
  --repo-type "dataset" \
  --arxiv-id "2312.99999"

# Step 6: Generate citation for README
uv run scripts/paper_manager.py citation \
  --arxiv-id "2312.99999" \
  --format "bibtex" > citation.bib
```

## Example 7: Batch Link Papers

Link multiple papers to multiple repositories:

```bash
#!/bin/bash

# List of papers
PAPERS=("2301.12345" "2302.67890" "2303.11111")

# List of models
MODELS=("username/model-a" "username/model-b" "username/model-c")

# Link each paper to each model
for paper in "${PAPERS[@]}"; do
  for model in "${MODELS[@]}"; do
    echo "Linking $paper to $model..."
    uv run scripts/paper_manager.py link \
      --repo-id "$model" \
      --repo-type "model" \
      --arxiv-id "$paper"
  done
done
```

## Example 8: Update Model Card with Paper Info

Get paper info and manually update model card:

```bash
# Get paper information
uv run scripts/paper_manager.py info \
  --arxiv-id "2301.12345" \
  --format "text" > paper_info.txt

# View the information
cat paper_info.txt

# Manually incorporate into your model card or use the link command
```

## Example 9: Search and Discover Papers

```bash
# Search for papers (opens browser)
uv run scripts/paper_manager.py search \
  --query "transformer attention mechanism"
```

## Example 10: Working with tfrere's Template

This skill complements [tfrere's research article template](https://huggingface.co/spaces/tfrere/research-article-template):

```bash
# 1. Use tfrere's Space to create a beautiful web-based paper
# Visit: https://huggingface.co/spaces/tfrere/research-article-template

# 2. Export your paper content to markdown

# 3. Submit to arXiv

# 4. Use this skill to index and link
uv run scripts/paper_manager.py index --arxiv-id "YOUR_ARXIV_ID"
uv run scripts/paper_manager.py link \
  --repo-id "your-username/your-model" \
  --arxiv-id "YOUR_ARXIV_ID"
```

## Example 11: Error Handling

```bash
# Check if paper exists before linking
if uv run scripts/paper_manager.py check --arxiv-id "2301.12345" | grep -q '"exists": true'; then
  echo "Paper exists, proceeding with link..."
  uv run scripts/paper_manager.py link \
    --repo-id "username/model" \
    --arxiv-id "2301.12345"
else
  echo "Paper doesn't exist, indexing first..."
  uv run scripts/paper_manager.py index --arxiv-id "2301.12345"
  uv run scripts/paper_manager.py link \
    --repo-id "username/model" \
    --arxiv-id "2301.12345"
fi
```

## Example 12: CI/CD Integration

Add to your `.github/workflows/update-paper.yml`:

```yaml
name: Update Paper Links

on:
  push:
    branches: [main]
  workflow_dispatch:

jobs:
  update:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Set up uv
        uses: astral-sh/setup-uv@v5

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.10'

      - name: Link paper to model
        env:
          HF_TOKEN: ${{ secrets.HF_TOKEN }}
        run: |
          uv run scripts/paper_manager.py link \
            --repo-id "${{ github.repository_owner }}/model-name" \
            --repo-type "model" \
            --arxiv-id "2301.12345"
```

## Tips and Best Practices

1. **Always check if paper exists** before indexing to avoid unnecessary operations
2. **Use meaningful commit messages** when linking papers to repositories
3. **Include full citations** in model cards for proper attribution
4. **Link papers to all relevant artifacts** (models, datasets, spaces)
5. **Generate BibTeX citations** for easy reference by others
6. **Keep paper visibility updated** in your HF profile settings
7. **Use templates consistently** within your research group
8. **Version control your papers** alongside code

## Troubleshooting

### Paper not found after indexing

```bash
# Visit the URL directly to trigger indexing
open "https://huggingface.co/papers/2301.12345"

# Wait a few seconds, then check again
uv run scripts/paper_manager.py check --arxiv-id "2301.12345"
```

### Permission denied when linking

```bash
# Verify your token has write access
echo $HF_TOKEN

# Set token if missing
export HF_TOKEN="your_token_here"

# Or use .env file
echo "HF_TOKEN=your_token_here" > .env
```

### arXiv ID format issues

```bash
# The script handles various formats:
uv run scripts/paper_manager.py check --arxiv-id "2301.12345"
uv run scripts/paper_manager.py check --arxiv-id "arxiv:2301.12345"
uv run scripts/paper_manager.py check --arxiv-id "https://arxiv.org/abs/2301.12345"

# All are equivalent and will be normalized
```

## Next Steps

- Explore the [Paper Pages documentation](https://huggingface.co/docs/hub/en/paper-pages)
- Check out [tfrere's research template](https://huggingface.co/spaces/tfrere/research-article-template)
- Browse [papers on HF](https://huggingface.co/papers)
- Learn about [model cards](https://huggingface.co/docs/hub/en/model-cards)

````


### `references/quick_reference.md`

````markdown
# Quick Reference Guide

## Essential Commands

### Paper Indexing
```bash
# Index from arXiv
uv run scripts/paper_manager.py index --arxiv-id "2301.12345"

# Check if exists
uv run scripts/paper_manager.py check --arxiv-id "2301.12345"
```

### Linking Papers
```bash
# Link to model
uv run scripts/paper_manager.py link \
  --repo-id "username/model" \
  --repo-type "model" \
  --arxiv-id "2301.12345"

# Link to dataset
uv run scripts/paper_manager.py link \
  --repo-id "username/dataset" \
  --repo-type "dataset" \
  --arxiv-id "2301.12345"

# Link multiple papers
uv run scripts/paper_manager.py link \
  --repo-id "username/model" \
  --repo-type "model" \
  --arxiv-ids "2301.12345,2302.67890"
```

### Creating Papers
```bash
# Standard template
uv run scripts/paper_manager.py create \
  --template "standard" \
  --title "Paper Title" \
  --output "paper.md"

# Modern template
uv run scripts/paper_manager.py create \
  --template "modern" \
  --title "Paper Title" \
  --authors "Author1, Author2" \
  --abstract "Abstract text" \
  --output "paper.md"

# ML Report
uv run scripts/paper_manager.py create \
  --template "ml-report" \
  --title "Experiment Report" \
  --output "report.md"

# arXiv style
uv run scripts/paper_manager.py create \
  --template "arxiv" \
  --title "Paper Title" \
  --output "paper.md"
```

### Citations
```bash
# Generate BibTeX
uv run scripts/paper_manager.py citation \
  --arxiv-id "2301.12345" \
  --format "bibtex"
```

### Paper Info
```bash
# JSON format
uv run scripts/paper_manager.py info \
  --arxiv-id "2301.12345" \
  --format "json"

# Text format
uv run scripts/paper_manager.py info \
  --arxiv-id "2301.12345" \
  --format "text"
```

## URL Formats

### Hugging Face Paper Pages
- View paper: `https://huggingface.co/papers/{arxiv-id}`
- Example: `https://huggingface.co/papers/2301.12345`

### arXiv
- Abstract: `https://arxiv.org/abs/{arxiv-id}`
- PDF: `https://arxiv.org/pdf/{arxiv-id}.pdf`
- Example: `https://arxiv.org/abs/2301.12345`

## YAML Metadata Format

### Model Card
```yaml
---
language:
  - en
license: apache-2.0
tags:
  - text-generation
  - transformers
library_name: transformers
---
```

### Dataset Card
```yaml
---
language:
  - en
license: cc-by-4.0
task_categories:
  - text-generation
size_categories:
  - 10K<n<100K
---
```

## arXiv ID Formats

All these formats work:
- `2301.12345`
- `arxiv:2301.12345`
- `https://arxiv.org/abs/2301.12345`
- `https://arxiv.org/pdf/2301.12345.pdf`

## Environment Setup

### Set Token
```bash
export HF_TOKEN="your_token"
```

### Or use .env file
```bash
echo "HF_TOKEN=your_token" > .env
```

## Common Workflows

### 1. Index & Link
```bash
uv run scripts/paper_manager.py index --arxiv-id "2301.12345"
uv run scripts/paper_manager.py link --repo-id "user/model" --arxiv-id "2301.12345"
```

### 2. Create & Publish
```bash
uv run scripts/paper_manager.py create --template "modern" --title "Title" --output "paper.md"
# Edit paper.md
# Submit to arXiv → get ID
uv run scripts/paper_manager.py index --arxiv-id "NEW_ID"
uv run scripts/paper_manager.py link --repo-id "user/model" --arxiv-id "NEW_ID"
```

### 3. Batch Link
```bash
for id in "2301.12345" "2302.67890"; do
  uv run scripts/paper_manager.py link --repo-id "user/model" --arxiv-id "$id"
done
```

## Troubleshooting

### Paper not found
Visit `https://huggingface.co/papers/{arxiv-id}` to trigger indexing

### Permission denied
Check `HF_TOKEN` is set and has write access

### arXiv API errors
Wait a moment and retry - arXiv has rate limits

## Tips

1. Always check paper exists before linking
2. Use templates for consistency
3. Include full citations in model cards
4. Link papers to all relevant artifacts
5. Keep citations up to date

## Templates Available

- `standard` - Traditional academic paper
- `modern` - Web-friendly format (Distill-style)
- `arxiv` - arXiv journal format
- `ml-report` - ML experiment documentation

## File Locations

- Scripts: `scripts/paper_manager.py`
- Templates: `templates/*.md`
- Examples: `examples/example_usage.md`
- This guide: `references/quick_reference.md`

## Getting Help

```bash
# Command help
uv run scripts/paper_manager.py --help

# Subcommand help
uv run scripts/paper_manager.py link --help
```

## Additional Resources

- [Full documentation](../SKILL.md)
- [Usage examples](../examples/example_usage.md)
- [HF Paper Pages](https://huggingface.co/papers)
- [tfrere's template](https://huggingface.co/spaces/tfrere/research-article-template)

````


### `scripts/paper_manager.py`

````
#!/usr/bin/env -S uv run
# /// script
# requires-python = ">=3.10"
# dependencies = [
#     "huggingface_hub",
#     "pyyaml",
#     "requests",
#     "python-dotenv",
# ]
# ///
"""
Paper Manager for Hugging Face Hub
Manages paper indexing, linking, authorship, and article creation.
"""

import argparse
import os
import sys
import re
import json
from pathlib import Path
from typing import Optional, List, Dict, Any
from datetime import datetime

try:
    from huggingface_hub import HfApi, hf_hub_download, get_token
    import yaml
    import requests
    from dotenv import load_dotenv
except ImportError as e:
    print(f"Error: Missing required dependency: {e}")
    print("Tip: run this script with `uv run scripts/paper_manager.py ...`.")
    sys.exit(1)

# Load environment variables
load_dotenv()


class PaperManager:
    """Manages paper publishing operations on Hugging Face Hub."""

    def __init__(self, hf_token: Optional[str] = None):
        """Initialize Paper Manager with HF token."""
        self.token = hf_token or os.getenv("HF_TOKEN") or get_token()
        if not self.token:
            print("Warning: No HF_TOKEN found. Some operations will fail.")
        self.api = HfApi(token=self.token)

    def index_paper(self, arxiv_id: str) -> Dict[str, Any]:
        """
        Index a paper on Hugging Face from arXiv.

        Args:
            arxiv_id: arXiv identifier (e.g., "2301.12345")

        Returns:
            dict: Status information
        """
        # Clean and validate arXiv ID
        try:
            arxiv_id = self._clean_arxiv_id(arxiv_id)
        except ValueError as e:
            print(f"Error: {e}")
            return {"status": "error", "message": str(e)}

        print(f"Indexing paper {arxiv_id} on Hugging Face...")

        # Check if paper exists
        paper_url = f"https://huggingface.co/papers/{arxiv_id}"

        try:
            response = requests.get(paper_url, timeout=10)
            if response.status_code == 200:
                print(f"✓ Paper already indexed at {paper_url}")
                return {"status": "exists", "url": paper_url}
            else:
                print(f"Paper not indexed. Visit {paper_url} to trigger indexing.")
                print("The paper will be automatically indexed when you first visit the URL.")
                return {"status": "not_indexed", "url": paper_url, "action": "visit_url"}
        except requests.RequestException as e:
            print(f"Error checking paper status: {e}")
            return {"status": "error", "message": str(e)}

    def check_paper(self, arxiv_id: str) -> Dict[str, Any]:
        """
        Check if a paper exists on Hugging Face.

        Args:
            arxiv_id: arXiv identifier

        Returns:
            dict: Paper status and metadata
        """
        try:
            arxiv_id = self._clean_arxiv_id(arxiv_id)
        except ValueError as e:
            return {"exists": False, "error": str(e)}
        paper_url = f"https://huggingface.co/papers/{arxiv_id}"

        try:
            response = requests.get(paper_url, timeout=10)
            if response.status_code == 200:
                return {
                    "exists": True,
                    "url": paper_url,
                    "arxiv_id": arxiv_id,
                    "arxiv_url": f"https://arxiv.org/abs/{arxiv_id}"
                }
            else:
                return {
                    "exists": False,
                    "arxiv_id": arxiv_id,
                    "index_url": paper_url,
                    "message": f"Visit {paper_url} to index this paper"
                }
        except requests.RequestException as e:
            return {"exists": False, "error": str(e)}

    def link_paper_to_repo(
        self,
        repo_id: str,
        arxiv_id: str,
        repo_type: str = "model",
        citation: Optional[str] = None,
        create_pr: bool = False
    ) -> Dict[str, Any]:
        """
        Link a paper to a model/dataset/space repository.

        Args:
            repo_id: Repository identifier (e.g., "username/repo-name")
            arxiv_id: arXiv identifier
            repo_type: Type of repository ("model", "dataset", or "space")
            citation: Optional full citation text
            create_pr: Create a PR instead of direct commit

        Returns:
            dict: Operation status
        """
        try:
            arxiv_id = self._clean_arxiv_id(arxiv_id)
        except ValueError as e:
            print(f"Error: {e}")
            return {"status": "error", "message": str(e)}

        print(f"Linking paper {arxiv_id} to {repo_type} {repo_id}...")

        try:
            # Download current README
            readme_path = hf_hub_download(
                repo_id=repo_id,
                filename="README.md",
                repo_type=repo_type,
                token=self.token
            )

            with open(readme_path, 'r', encoding='utf-8') as f:
                content = f.read()

            # Parse or create YAML frontmatter
            updated_content = self._add_paper_to_readme(content, arxiv_id, citation)

            # Upload updated README
            commit_message = f"Add paper reference: arXiv:{arxiv_id}"

            if create_pr:
                # Create PR (not implemented in basic version)
                print("PR creation not yet implemented. Committing directly.")

            self.api.upload_file(
                path_or_fileobj=updated_content.encode('utf-8'),
                path_in_repo="README.md",
                repo_id=repo_id,
                repo_type=repo_type,
                commit_message=commit_message,
                token=self.token
            )

            paper_url = f"https://huggingface.co/papers/{arxiv_id}"
            repo_url = f"https://huggingface.co/{repo_id}"

            print(f"✓ Successfully linked paper to repository")
            print(f"  Paper: {paper_url}")
            print(f"  Repo: {repo_url}")

            return {
                "status": "success",
                "paper_url": paper_url,
                "repo_url": repo_url,
                "arxiv_id": arxiv_id
            }

        except Exception as e:
            print(f"Error linking paper: {e}")
            return {"status": "error", "message": str(e)}

    def _add_paper_to_readme(
        self,
        content: str,
        arxiv_id: str,
        citation: Optional[str] = None
    ) -> str:
        """
        Add paper reference to README content.

        Args:
            content: Current README content
            arxiv_id: arXiv identifier
            citation: Optional citation text

        Returns:
            str: Updated README content
        """
        arxiv_url = f"https://arxiv.org/abs/{arxiv_id}"
        hf_paper_url = f"https://huggingface.co/papers/{arxiv_id}"

        # Check if YAML frontmatter exists
        yaml_pattern = r'^---\s*\n(.*?)\n---\s*\n'
        match = re.match(yaml_pattern, content, re.DOTALL)

        if match:
            # YAML exists, check if paper already referenced
            if arxiv_id in content:
                print(f"Paper {arxiv_id} already referenced in README")
                return content

            # Add to existing content (after YAML)
            yaml_end = match.end()
            before = content[:yaml_end]
            after = content[yaml_end:]
        else:
            # No YAML, add minimal frontmatter
            yaml_content = "---\n---\n\n"
            before = yaml_content
            after = content

        # Add paper reference section with boundary markers
        paper_section = "\n<!-- paper-manager:start -->\n"
        paper_section += f"## Paper\n\n"
        paper_section += f"This {'model' if 'model' in content.lower() else 'work'} is based on research presented in:\n\n"
        paper_section += f"**[View on arXiv]({arxiv_url})** | "
        paper_section += f"**[View on Hugging Face]({hf_paper_url})**\n\n"

        if citation:
            safe_citation = self._sanitize_text(citation)
            paper_section += f"### Citation\n\n```bibtex\n{safe_citation}\n```\n\n"

        paper_section += "<!-- paper-manager:end -->\n"

        # Insert after YAML, before main content
        updated_content = before + paper_section + after

        return updated_content

    def create_research_article(
        self,
        template: str,
        title: str,
        output: str,
        authors: Optional[str] = None,
        abstract: Optional[str] = None
    ) -> Dict[str, Any]:
        """
        Create a research article from template.

        Args:
            template: Template name ("standard", "modern", "arxiv", "ml-report")
            title: Paper title
            output: Output filename
            authors: Comma-separated author names
            abstract: Abstract text

        Returns:
            dict: Creation status
        """
        print(f"Creating research article with '{template}' template...")

        # Load template
        template_dir = Path(__file__).parent.parent / "templates"
        template_file = template_dir / f"{template}.md"

        if not template_file.exists():
            return {
                "status": "error",
                "message": f"Template '{template}' not found at {template_file}"
            }

        with open(template_file, 'r', encoding='utf-8') as f:
            template_content = f.read()

        # Prepare safe values for different contexts
        date_str = datetime.now().strftime("%Y-%m-%d")
        safe_title_body = self._sanitize_text(title)
        authors_val = authors if authors else "Your Name"
        safe_authors_body = self._sanitize_text(authors_val)
        abstract_val = abstract if abstract else "Abstract to be written..."
        safe_abstract_body = self._sanitize_text(abstract_val)

        # Split frontmatter from body for context-aware escaping
        fm_pattern = r'^(---\s*\n)(.*?\n)(---\s*\n)'
        fm_match = re.match(fm_pattern, template_content, re.DOTALL)

        if fm_match:
            fm_open, fm_body, fm_close = fm_match.group(1), fm_match.group(2), fm_match.group(3)
            body = template_content[fm_match.end():]

            # YAML-escape values in frontmatter
            fm_body = fm_body.replace("{{TITLE}}", self._escape_yaml_value(title))
            fm_body = fm_body.replace("{{AUTHORS}}", self._escape_yaml_value(authors_val))
            fm_body = fm_body.replace("{{DATE}}", date_str)

            # Sanitize values in body
            body = body.replace("{{TITLE}}", safe_title_body)
            body = body.replace("{{AUTHORS}}", safe_authors_body)
            body = body.replace("{{ABSTRACT}}", safe_abstract_body)
            body = body.replace("{{DATE}}", date_str)

            content = fm_open + fm_body + fm_close + body
        else:
            # No frontmatter — sanitize everything
            content = template_content.replace("{{TITLE}}", safe_title_body)
            content = content.replace("{{DATE}}", date_str)
            content = content.replace("{{AUTHORS}}", safe_authors_body)
            content = content.replace("{{ABSTRACT}}", safe_abstract_body)

        # Write output
        with open(output, 'w', encoding='utf-8') as f:
            f.write(content)

        print(f"✓ Research article created at {output}")

        return {
            "status": "success",
            "output": output,
            "template": template
        }

    def get_arxiv_info(self, arxiv_id: str) -> Dict[str, Any]:
        """
        Fetch paper information from arXiv API.

        Args:
            arxiv_id: arXiv identifier

        Returns:
            dict: Paper metadata
        """
        try:
            arxiv_id = self._clean_arxiv_id(arxiv_id)
        except ValueError as e:
            return {"error": str(e)}
        api_url = f"https://export.arxiv.org/api/query?id_list={arxiv_id}"

        try:
            response = requests.get(api_url, timeout=10)
            response.raise_for_status()

            # Parse XML response (simplified)
            content = response.text

            # Extract basic info with regex (proper XML parsing would be better)
            title_match = re.search(r'<title>(.*?)</title>', content, re.DOTALL)
            authors_matches = re.findall(r'<name>(.*?)</name>', content)
            summary_match = re.search(r'<summary>(.*?)</summary>', content, re.DOTALL)

            # Sanitize all text extracted from the external API
            raw_title = title_match.group(1).strip() if title_match else None
            raw_authors = authors_matches[1:] if len(authors_matches) > 1 else []
            raw_abstract = summary_match.group(1).strip() if summary_match else None

            return {
                "arxiv_id": arxiv_id,
                "title": self._sanitize_text(raw_title) if raw_title else None,
                "authors": [self._sanitize_text(a) for a in raw_authors],
                "abstract": self._sanitize_text(raw_abstract) if raw_abstract else None,
                "arxiv_url": f"https://arxiv.org/abs/{arxiv_id}",
                "pdf_url": f"https://arxiv.org/pdf/{arxiv_id}.pdf"
            }
        except Exception as e:
            return {"error": str(e)}

    def generate_citation(
        self,
        arxiv_id: str,
        format: str = "bibtex"
    ) -> str:
        """
        Generate citation for a paper.

        Args:
            arxiv_id: arXiv identifier
            format: Citation format ("bibtex", "apa", "mla")

        Returns:
            str: Formatted citation
        """
        try:
            arxiv_id = self._clean_arxiv_id(arxiv_id)
        except ValueError as e:
            return f"Error: {e}"

        info = self.get_arxiv_info(arxiv_id)

        if "error" in info:
            return f"Error fetching paper info: {info['error']}"

        if format == "bibtex":
            # Generate BibTeX citation
            key = f"arxiv{arxiv_id.replace('.', '_')}"
            raw_authors = " and ".join(info.get("authors", ["Unknown"]))
            raw_title = info.get("title", "Untitled")
            year = arxiv_id.split(".")[0][:2]  # Extract year from ID (simplified)
            year = f"20{year}" if int(year) < 50 else f"19{year}"

            # Escape BibTeX structural characters in untrusted values
            safe_title = raw_title.replace('{', r'\{').replace('}', r'\}')
            safe_authors = raw_authors.replace('{', r'\{').replace('}', r'\}')

            citation = f"""@article{{{key},
  title={{{safe_title}}},
  author={{{safe_authors}}},
  journal={{arXiv preprint arXiv:{arxiv_id}}},
  year={{{year}}}
}}"""
            return citation

        return f"Format '{format}' not yet implemented"

    # Patterns for valid arXiv IDs
    _ARXIV_ID_MODERN = re.compile(r'^\d{4}\.\d{4,5}(v\d+)?$')
    _ARXIV_ID_LEGACY = re.compile(r'^[a-zA-Z\-]+/\d{7}(v\d+)?$')

    @staticmethod
    def _clean_arxiv_id(arxiv_id: str) -> str:
        """Clean, normalize, and validate arXiv ID.

        Raises:
            ValueError: If the cleaned ID does not match a valid arXiv format.
        """
        # Remove common prefixes and whitespace
        arxiv_id = arxiv_id.strip()
        arxiv_id = re.sub(r'^(arxiv:|arXiv:)', '', arxiv_id, flags=re.IGNORECASE)
        arxiv_id = re.sub(r'https?://arxiv\.org/(abs|pdf)/', '', arxiv_id)
        arxiv_id = arxiv_id.replace('.pdf', '')

        # Validate format
        if not (PaperManager._ARXIV_ID_MODERN.match(arxiv_id)
                or PaperManager._ARXIV_ID_LEGACY.match(arxiv_id)):
            raise ValueError(
                f"Invalid arXiv ID: {arxiv_id!r}. "
                "Expected format: YYMM.NNNNN[vN] or category/YYMMNNN[vN]"
            )

        return arxiv_id

    @staticmethod
    def _escape_yaml_value(value: str) -> str:
        """Escape a string for safe use as a YAML scalar value.

        Wraps in double quotes and escapes internal quotes and backslashes
        to prevent YAML injection via crafted titles/authors.
        """
        value = value.replace('\\', '\\\\').replace('"', '\\"')
        return f'"{value}"'

    @staticmethod
    def _sanitize_text(text: str) -> str:
        """Sanitize untrusted text for safe inclusion in Markdown/YAML output.

        Normalizes whitespace, strips control characters, and neutralizes
        markdown code-fence breakout and YAML document delimiters.
        """
        # Remove control characters (keep newlines and tabs)
        text = re.sub(r'[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]', '', text)
        # Normalize whitespace runs (collapse multiple spaces/tabs, preserve single newlines)
        text = re.sub(r'[^\S\n]+', ' ', text)
        text = re.sub(r'\n{3,}', '\n\n', text)
        # Neutralize markdown code fence breakout
        text = text.replace('```', r'\`\`\`')
        # Neutralize YAML document delimiters at line start
        text = re.sub(r'^---', r'\\---', text, flags=re.MULTILINE)
        return text.strip()


def main():
    """Main CLI entry point."""
    parser = argparse.ArgumentParser(
        description="Paper Manager for Hugging Face Hub",
        formatter_class=argparse.RawDescriptionHelpFormatter
    )

    subparsers = parser.add_subparsers(dest="command", help="Command to execute")

    # Index command
    index_parser = subparsers.add_parser("index", help="Index a paper from arXiv")
    index_parser.add_argument("--arxiv-id", required=True, help="arXiv paper ID")

    # Check command
    check_parser = subparsers.add_parser("check", help="Check if paper exists")
    check_parser.add_argument("--arxiv-id", required=True, help="arXiv paper ID")

    # Link command
    link_parser = subparsers.add_parser("link", help="Link paper to repository")
    link_parser.add_argument("--repo-id", required=True, help="Repository ID")
    link_parser.add_argument("--repo-type", default="model", choices=["model", "dataset", "space"])
    link_parser.add_argument("--arxiv-id", help="Single arXiv ID")
    link_parser.add_argument("--arxiv-ids", help="Comma-separated arXiv IDs")
    link_parser.add_argument("--citation", help="Full citation text")
    link_parser.add_argument("--create-pr", action="store_true", help="Create PR instead of direct commit")

    # Create command
    create_parser = subparsers.add_parser("create", help="Create research article")
    create_parser.add_argument("--template", required=True, help="Template name")
    create_parser.add_argument("--title", required=True, help="Paper title")
    create_parser.add_argument("--output", required=True, help="Output filename")
    create_parser.add_argument("--authors", help="Comma-separated authors")
    create_parser.add_argument("--abstract", help="Abstract text")

    # Info command
    info_parser = subparsers.add_parser("info", help="Get paper information")
    info_parser.add_argument("--arxiv-id", required=True, help="arXiv paper ID")
    info_parser.add_argument("--format", default="json", choices=["json", "text"])

    # Citation command
    citation_parser = subparsers.add_parser("citation", help="Generate citation")
    citation_parser.add_argument("--arxiv-id", required=True, help="arXiv paper ID")
    citation_parser.add_argument("--format", default="bibtex", choices=["bibtex", "apa", "mla"])

    # Search command
    search_parser = subparsers.add_parser("search", help="Search papers")
    search_parser.add_argument("--query", required=True, help="Search query")

    args = parser.parse_args()

    if not args.command:
        parser.print_help()
        sys.exit(1)

    # Initialize manager
    manager = PaperManager()

    # Execute command
    if args.command == "index":
        result = manager.index_paper(args.arxiv_id)
        print(json.dumps(result, indent=2))

    elif args.command == "check":
        result = manager.check_paper(args.arxiv_id)
        print(json.dumps(result, indent=2))

 
...<truncated>
````


### `templates/arxiv.md`

````markdown
---
title: {{TITLE}}
authors: {{AUTHORS}}
date: {{DATE}}
arxiv:
layout: arxiv
---

# {{TITLE}}

<div class="arxiv-header">

**{{AUTHORS}}**

*Submitted to arXiv: {{DATE}}*

</div>

---

**Abstract**—{{ABSTRACT}}

**Index Terms**—Machine Learning, Deep Learning, Neural Networks

---

## I. INTRODUCTION

**T**HIS paper presents [brief overview of the contribution]. The main contributions of this work are:

- Contribution 1: Description
- Contribution 2: Description
- Contribution 3: Description

The rest of this paper is organized as follows: Section II reviews related work, Section III describes the proposed methodology, Section IV presents experimental results, and Section V concludes the paper.

## II. RELATED WORK

### A. Subarea 1

Discussion of relevant prior work in subarea 1.

### B. Subarea 2

Discussion of relevant prior work in subarea 2.

### C. Comparison with Prior Art

Table comparing existing methods:

| Method | Year | Approach | Limitation |
|--------|------|----------|------------|
| Method A [1] | 2020 | Description | Issue |
| Method B [2] | 2021 | Description | Issue |
| Method C [3] | 2023 | Description | Issue |

## III. METHODOLOGY

### A. Problem Formulation

Let $X = \{x_1, x_2, ..., x_n\}$ be the input space and $Y = \{y_1, y_2, ..., y_m\}$ be the output space. We aim to learn a function $f: X \rightarrow Y$ that minimizes:

$$
\mathcal{L}(\theta) = \sum_{i=1}^{N} \ell(f(x_i; \theta), y_i) + \lambda R(\theta)
$$

where $\theta$ represents model parameters, $\ell$ is the loss function, and $R(\theta)$ is a regularization term.

### B. Model Architecture

Describe the model architecture in detail.

**Input Layer**: Description

**Hidden Layers**: Let $h^{(l)}$ denote the activation of layer $l$:

$$
h^{(l)} = \sigma(W^{(l)}h^{(l-1)} + b^{(l)})
$$

where $\sigma$ is the activation function, $W^{(l)}$ is the weight matrix, and $b^{(l)}$ is the bias vector.

**Output Layer**: Description

### C. Training Algorithm

**Algorithm 1**: Training Procedure

```
1: Input: Training data D = {(xi, yi)}
2: Initialize parameters θ
3: for epoch = 1 to max_epochs do
4:     for each mini-batch B ⊂ D do
5:         Compute loss: L(θ) = 1/|B| Σ ℓ(f(xi; θ), yi)
6:         Update: θ ← θ - η∇θL(θ)
7:     end for
8: end for
9: Return: Trained parameters θ*
```

### D. Complexity Analysis

**Time Complexity**: The training algorithm has time complexity $O(NTE)$ where $N$ is the dataset size, $T$ is the number of epochs, and $E$ is the per-example computation cost.

**Space Complexity**: The model requires $O(P)$ space where $P$ is the number of parameters.

## IV. EXPERIMENTS

### A. Experimental Setup

**Datasets**: We evaluate on the following benchmarks:

1. **Dataset A**: Description (size, splits, characteristics)
2. **Dataset B**: Description
3. **Dataset C**: Description

**Baselines**: We compare against:

- Baseline 1 [4]: Description
- Baseline 2 [5]: Description
- Baseline 3 [6]: Description

**Evaluation Metrics**: Performance is measured using:

- Metric 1: Definition
- Metric 2: Definition
- Metric 3: Definition

**Implementation Details**: All experiments are conducted using:

- Framework: PyTorch 2.0
- Hardware: NVIDIA A100 GPUs
- Hyperparameters: Learning rate $\eta = 10^{-4}$, batch size $B = 32$, epochs $T = 100$

### B. Quantitative Results

**TABLE I: MAIN RESULTS**

| Method | Dataset A | Dataset B | Dataset C | Average |
|--------|-----------|-----------|-----------|---------|
| Baseline 1 [4] | 82.3 | 78.5 | 80.1 | 80.3 |
| Baseline 2 [5] | 85.7 | 82.1 | 83.9 | 83.9 |
| Baseline 3 [6] | 88.1 | 85.3 | 86.7 | 86.7 |
| **Ours** | **91.2** | **88.9** | **90.1** | **90.1** |

Our method achieves state-of-the-art performance across all three benchmarks, with an average improvement of 3.4 percentage points over the previous best method.

### C. Ablation Study

**TABLE II: ABLATION STUDY RESULTS**

| Configuration | Dataset A | Δ |
|---------------|-----------|---|
| Full Model | 91.2 | - |
| w/o Component A | 88.7 | -2.5 |
| w/o Component B | 89.4 | -1.8 |
| w/o Component C | 90.5 | -0.7 |

The ablation study demonstrates that all components contribute to the final performance, with Component A having the largest impact.

### D. Qualitative Analysis

**Fig. 1**: Visualization of learned representations using t-SNE projection.

**Fig. 2**: Example predictions showing correct classifications and failure cases.

### E. Computational Efficiency

**TABLE III: COMPUTATIONAL REQUIREMENTS**

| Method | Parameters | FLOPs | Inference (ms) |
|--------|------------|-------|----------------|
| Baseline 1 [4] | 50M | 10G | 8.2 |
| Baseline 2 [5] | 100M | 25G | 15.7 |
| Baseline 3 [6] | 200M | 50G | 28.3 |
| **Ours** | **80M** | **18G** | **12.1** |

Our method achieves superior performance while maintaining reasonable computational costs.

## V. DISCUSSION

### A. Analysis of Results

The experimental results demonstrate that [analysis].

### B. Limitations

Current limitations include:

1. Limitation 1: Description
2. Limitation 2: Description
3. Limitation 3: Description

### C. Broader Impact

Potential applications include:

- Application 1: Description
- Application 2: Description
- Application 3: Description

**Ethical Considerations**: [Discussion of potential risks and mitigation strategies]

## VI. CONCLUSION

This paper presented {{TITLE}}, which achieves [main achievement]. The key contributions are:

1. Contribution 1: Summary
2. Contribution 2: Summary
3. Contribution 3: Summary

Future work will focus on [future directions].

## ACKNOWLEDGMENTS

The authors thank [acknowledgments]. This work was supported by [funding sources].

## REFERENCES

[1] Author A et al., "Paper Title," *Conference Name*, 2020.

[2] Author B et al., "Paper Title," *Journal Name*, vol. X, no. Y, pp. Z-W, 2021.

[3] Author C et al., "Paper Title," *arXiv preprint arXiv:XXXX.XXXXX*, 2023.

[4] Author D et al., "Baseline 1 Paper," *Conference*, 2019.

[5] Author E et al., "Baseline 2 Paper," *Conference*, 2021.

[6] Author F et al., "Baseline 3 Paper," *Conference*, 2023.

---

## APPENDIX A: ADDITIONAL EXPERIMENTS

Supplementary experimental results.

## APPENDIX B: PROOF OF THEOREM

**Theorem 1**: Statement of theorem.

**Proof**: Detailed proof.

## APPENDIX C: HYPERPARAMETERS

Complete list of hyperparameters used in all experiments:

| Hyperparameter | Value | Description |
|----------------|-------|-------------|
| Learning rate | $10^{-4}$ | Initial learning rate |
| Batch size | 32 | Training batch size |
| Epochs | 100 | Number of training epochs |
| Optimizer | AdamW | Optimization algorithm |
| Weight decay | 0.01 | L2 regularization coefficient |
| Warmup steps | 1000 | LR warmup duration |
| Dropout | 0.1 | Dropout probability |

---

<style>
.arxiv-header {
    text-align: center;
    margin-bottom: 2em;
}

body {
    font-family: 'Computer Modern', serif;
    line-height: 1.6;
}

h1 {
    text-align: center;
    font-size: 1.8em;
    margin-top: 1em;
}

h2 {
    font-size: 1.3em;
    margin-top: 1.5em;
    font-weight: bold;
}

h3 {
    font-size: 1.1em;
    font-style: italic;
    margin-top: 1em;
}

table {
    margin: 1em auto;
    border-collapse: collapse;
}

th, td {
    border: 1px solid #000;
    padding: 0.5em;
    text-align: center;
}
</style>

````


### `templates/ml-report.md`

````markdown
---
title: {{TITLE}}
authors: {{AUTHORS}}
date: {{DATE}}
type: ml-experiment-report
tags: [machine-learning, experiment-report]
---

# {{TITLE}}

**Machine Learning Experiment Report**

**Researchers**: {{AUTHORS}}
**Date**: {{DATE}}
**Status**: Draft / Final / In Review

---

## Executive Summary

{{ABSTRACT}}

### Key Findings
- Finding 1
- Finding 2
- Finding 3

### Recommendations
- Recommendation 1
- Recommendation 2

---

## 1. Objective

### 1.1 Research Question

What specific question are we trying to answer?

### 1.2 Success Criteria

How will we measure success?

- **Metric 1**: Target value
- **Metric 2**: Target value
- **Metric 3**: Target value

### 1.3 Constraints

- Computational budget
- Time constraints
- Data availability

---

## 2. Dataset

### 2.1 Data Description

| Property | Value |
|----------|-------|
| **Name** | Dataset name |
| **Source** | Origin of data |
| **Size** | Number of examples |
| **Features** | Feature count and types |
| **Target** | What we're predicting |
| **License** | Usage rights |

### 2.2 Data Splits

| Split | Size | Percentage |
|-------|------|------------|
| Train | X examples | Y% |
| Validation | X examples | Y% |
| Test | X examples | Y% |

### 2.3 Data Quality

- **Missing Values**: Analysis and handling
- **Outliers**: Detection and treatment
- **Imbalance**: Class distribution
- **Preprocessing**: Transformations applied

### 2.4 Exploratory Analysis

Key insights from data exploration:

1. Pattern 1
2. Pattern 2
3. Pattern 3

---

## 3. Model

### 3.1 Architecture

Describe the model architecture:

```
Input → Layer 1 → Layer 2 → ... → Output
```

### 3.2 Model Specifications

| Component | Configuration |
|-----------|--------------|
| **Type** | Model family |
| **Parameters** | Total count |
| **Layers** | Number and types |
| **Activation** | Functions used |
| **Dropout** | Regularization rate |

### 3.3 Baseline Models

What are we comparing against?

1. **Baseline 1**: Simple baseline (e.g., majority class)
2. **Baseline 2**: Standard approach (e.g., logistic regression)
3. **Baseline 3**: Previous best method

---

## 4. Training

### 4.1 Hyperparameters

| Hyperparameter | Value | Rationale |
|----------------|-------|-----------|
| Learning Rate | 1e-4 | Tuned via grid search |
| Batch Size | 32 | GPU memory constraint |
| Epochs | 100 | Based on validation |
| Optimizer | AdamW | Standard for transformers |
| Weight Decay | 0.01 | Regularization |
| LR Schedule | Cosine | Smooth convergence |

### 4.2 Training Process

```python
# Training pseudocode
for epoch in range(num_epochs):
    train_loss = train_one_epoch(model, train_loader)
    val_loss = validate(model, val_loader)
    if val_loss < best_loss:
        save_checkpoint(model)
```

### 4.3 Computational Resources

| Resource | Specification |
|----------|--------------|
| **Hardware** | GPU model and count |
| **Memory** | RAM and VRAM |
| **Training Time** | Hours/days |
| **Cost** | Estimated compute cost |

### 4.4 Training Curves

Include plots of:
- Training loss over time
- Validation loss over time
- Learning rate schedule
- Other relevant metrics

---

## 5. Results

### 5.1 Quantitative Results

| Model | Accuracy | Precision | Recall | F1 | AUC |
|-------|----------|-----------|--------|-------|-----|
| Baseline 1 | 0.65 | 0.64 | 0.66 | 0.65 | 0.70 |
| Baseline 2 | 0.78 | 0.77 | 0.79 | 0.78 | 0.82 |
| **Ours** | **0.89** | **0.88** | **0.90** | **0.89** | **0.93** |

### 5.2 Statistical Significance

- **P-value**: Statistical test results
- **Confidence Intervals**: 95% CI for key metrics
- **Multiple Runs**: Mean ± std over N runs

### 5.3 Per-Class Performance

| Class | Precision | Recall | F1 | Support |
|-------|-----------|--------|-----|---------|
| Class 1 | 0.90 | 0.88 | 0.89 | 500 |
| Class 2 | 0.87 | 0.91 | 0.89 | 450 |
| Class 3 | 0.88 | 0.89 | 0.88 | 550 |

### 5.4 Qualitative Results

#### Success Cases

Examples where the model performs well.

#### Failure Cases

Examples where the model fails and why.

---

## 6. Analysis

### 6.1 Ablation Study

| Configuration | Score | Change |
|---------------|-------|--------|
| Full Model | 0.89 | - |
| - Feature Set A | 0.85 | -0.04 |
| - Feature Set B | 0.87 | -0.02 |
| - Augmentation | 0.86 | -0.03 |

### 6.2 Error Analysis

What types of errors is the model making?

1. **Error Type 1**: Frequency and cause
2. **Error Type 2**: Frequency and cause
3. **Error Type 3**: Frequency and cause

### 6.3 Feature Importance

Which features matter most?

| Feature | Importance | Notes |
|---------|------------|-------|
| Feature 1 | 0.35 | Most predictive |
| Feature 2 | 0.28 | Secondary signal |
| Feature 3 | 0.15 | Marginal impact |

---

## 7. Robustness

### 7.1 Cross-Dataset Evaluation

How does the model generalize to other datasets?

| Dataset | Score | Notes |
|---------|-------|-------|
| Original | 0.89 | Training distribution |
| Dataset A | 0.82 | Similar domain |
| Dataset B | 0.71 | Different domain |

### 7.2 Adversarial Robustness

Performance under adversarial conditions.

### 7.3 Fairness Analysis

Performance across demographic groups or sensitive attributes.

---

## 8. Deployment Considerations

### 8.1 Model Size

- **Parameters**: Total count
- **Disk Size**: MB/GB on disk
- **Memory**: Runtime memory usage

### 8.2 Inference Speed

| Batch Size | Latency | Throughput |
|------------|---------|------------|
| 1 | 10ms | 100 QPS |
| 8 | 45ms | 178 QPS |
| 32 | 150ms | 213 QPS |

### 8.3 Production Requirements

- **Dependencies**: Software requirements
- **Infrastructure**: Hardware needs
- **Monitoring**: What to track in production
- **Fallback**: Backup strategy

---

## 9. Conclusions

### 9.1 Summary

Key takeaways from the experiment.

### 9.2 Did We Meet Objectives?

| Objective | Status | Notes |
|-----------|--------|-------|
| Objective 1 | ✅ Met | Achieved target |
| Objective 2 | ⚠️ Partial | Close to target |
| Objective 3 | ❌ Not Met | Needs more work |

### 9.3 Lessons Learned

What did we learn from this experiment?

1. Lesson 1
2. Lesson 2
3. Lesson 3

---

## 10. Next Steps

### 10.1 Short-term (1-2 weeks)

- [ ] Task 1
- [ ] Task 2
- [ ] Task 3

### 10.2 Medium-term (1-2 months)

- [ ] Task 1
- [ ] Task 2
- [ ] Task 3

### 10.3 Long-term (3+ months)

- [ ] Task 1
- [ ] Task 2
- [ ] Task 3

---

## References

1. Reference 1
2. Reference 2
3. Reference 3

---

## Appendix

### A. Hyperparameter Search

Results from hyperparameter tuning.

### B. Additional Experiments

Supplementary experiments not included in main text.

### C. Code

Links to code repositories:
- Training code: [link]
- Evaluation code: [link]
- Model checkpoint: [link]

### D. Data Card

Detailed data documentation following standard practices.

### E. Model Card

Model documentation following responsible AI practices.

````


### `templates/modern.md`

````markdown
---
title: {{TITLE}}
authors: {{AUTHORS}}
date: {{DATE}}
arxiv:
tags: [machine-learning, ai]
layout: modern
---

<div class="header">

# {{TITLE}}

<div class="authors">
{{AUTHORS}}
</div>

<div class="date">
{{DATE}}
</div>

<div class="links">
[arXiv](#) · [PDF](#) · [Code](#) · [Demo](#)
</div>

</div>

---

## Abstract

<div class="abstract">

{{ABSTRACT}}

</div>

---

## Introduction

Modern research requires clear, accessible communication. This template provides a clean, web-friendly format inspired by Distill and modern scientific publications.

<div class="key-insight">
💡 **Key Insight**: Present your main contribution upfront to engage readers immediately.
</div>

### Why This Matters

Explain the significance of your work in plain language. What real-world problems does it solve?

### Our Approach

Summarize your methodology at a high level before diving into details.

---

## Background

<div class="definition">
**Definition**: Clearly define key terms and concepts early in the paper.
</div>

Provide context necessary to understand your contribution without overwhelming readers with details.

### Problem Statement

Formally state the problem you're addressing.

### Challenges

What makes this problem difficult?

1. **Challenge 1**: Description
2. **Challenge 2**: Description
3. **Challenge 3**: Description

---

## Method

Present your approach with clear visual aids and intuitive explanations.

<div class="figure">

```
[Diagram of your architecture goes here]
```

**Figure 1**: Overview of the proposed method. Caption explains the key components.

</div>

### Model Architecture

Describe your model systematically:

```python
# Pseudocode example
class YourModel:
    def __init__(self):
        self.encoder = Encoder()
        self.decoder = Decoder()

    def forward(self, x):
        z = self.encoder(x)
        output = self.decoder(z)
        return output
```

### Training Strategy

Explain how you train the model, including:

- **Objective Function**: Mathematical formulation
- **Optimization**: Algorithm and hyperparameters
- **Regularization**: Techniques to prevent overfitting

---

## Experiments

### Setup

<div class="experiment-details">

| Component | Configuration |
|-----------|--------------|
| **Dataset** | Name, Size, Split |
| **Hardware** | GPU Type, RAM |
| **Framework** | PyTorch 2.0, Transformers |
| **Training Time** | Hours/Days |

</div>

### Results

Present results clearly with tables and visualizations.

<div class="results-table">

| Model | Accuracy | F1 Score | Params | Speed |
|-------|----------|----------|--------|-------|
| Baseline | 85.2% | 0.84 | 100M | 100 tok/s |
| **Ours** | **92.1%** | **0.91** | 120M | 95 tok/s |
| SOTA | 90.5% | 0.89 | 300M | 60 tok/s |

</div>

<div class="insight">
🔍 **Observation**: Our method achieves state-of-the-art performance with fewer parameters.
</div>

### Analysis

Deep dive into what the results reveal:

1. **Performance**: How does your method compare?
2. **Efficiency**: What are the computational costs?
3. **Robustness**: How does it perform across different scenarios?

---

## Ablation Study

Systematically evaluate each component's contribution.

<div class="ablation-results">

| Configuration | Score | Δ |
|---------------|-------|---|
| Full Model | 92.1% | - |
| - Component A | 89.3% | -2.8% |
| - Component B | 90.1% | -2.0% |
| - Component C | 91.5% | -0.6% |

</div>

**Conclusion**: All components contribute meaningfully, with Component A being most critical.

---

## Discussion

### What We Learned

Synthesize insights from your experiments.

### Limitations

<div class="limitations">

⚠️ **Current Limitations**:

1. Performance on domain X is limited
2. Computational requirements are high
3. Requires large training datasets

</div>

### Future Directions

Where should the community go next?

- **Direction 1**: Description
- **Direction 2**: Description
- **Direction 3**: Description

---

## Related Work

Compare and contrast with existing methods.

### Prior Approaches

| Method | Year | Key Idea | Limitation |
|--------|------|----------|------------|
| Method A | 2020 | Approach 1 | Issue X |
| Method B | 2021 | Approach 2 | Issue Y |
| Method C | 2023 | Approach 3 | Issue Z |

### How We Differ

Clearly articulate what's novel about your work.

---

## Conclusion

<div class="conclusion">

We presented **{{TITLE}}**, which achieves:

1. ✅ **Main contribution 1**
2. ✅ **Main contribution 2**
3. ✅ **Main contribution 3**

Our results demonstrate [key finding], opening new directions for [future work].

</div>

---

## Reproducibility

<div class="reproducibility">

### Code & Data

- **Code**: [github.com/username/repo](#)
- **Models**: [huggingface.co/username/model](#)
- **Datasets**: [huggingface.co/datasets/username/dataset](#)
- **Demo**: [huggingface.co/spaces/username/demo](#)

### Citation

```bibtex
@article{yourpaper2025,
  title={{{{TITLE}}}},
  author={{{{AUTHORS}}}},
  year={2025},
  journal={arXiv preprint}
}
```

</div>

---

## Acknowledgments

Thank funding agencies, collaborators, and computing resources that made this work possible.

---

<div class="appendix">

## Appendix

### A. Additional Results

Supplementary experiments and extended results.

### B. Hyperparameters

Complete training configuration:

```yaml
learning_rate: 1e-4
batch_size: 32
epochs: 100
optimizer: AdamW
scheduler: cosine
warmup_steps: 1000
```

### C. Dataset Details

Detailed information about datasets used.

</div>

---

<style>
.header { text-align: center; margin-bottom: 2em; }
.authors { font-size: 1.2em; margin: 0.5em 0; }
.date { color: #666; margin: 0.5em 0; }
.links { margin-top: 1em; }
.abstract { background: #f5f5f5; padding: 1.5em; border-radius: 8px; margin: 1em 0; }
.key-insight, .insight { background: #e8f4f8; border-left: 4px solid #2196F3; padding: 1em; margin: 1em 0; }
.definition { background: #fff3e0; border-left: 4px solid #ff9800; padding: 1em; margin: 1em 0; }
.limitations { background: #ffebee; border-left: 4px solid #f44336; padding: 1em; margin: 1em 0; }
.conclusion { background: #e8f5e9; border-left: 4px solid #4caf50; padding: 1.5em; margin: 1em 0; }
.figure { text-align: center; margin: 2em 0; }
.experiment-details, .results-table, .ablation-results { margin: 1em 0; }
.reproducibility { background: #f5f5f5; padding: 1.5em; border-radius: 8px; margin: 2em 0; }
</style>

````


### `templates/standard.md`

```markdown
---
title: {{TITLE}}
authors: {{AUTHORS}}
date: {{DATE}}
arxiv:
tags: [machine-learning, deep-learning]
---

# {{TITLE}}

**{{AUTHORS}}**

*{{DATE}}*

---

## Abstract

{{ABSTRACT}}

---

## 1. Introduction

Provide background and motivation for your research. Explain:
- What problem are you addressing?
- Why is it important?
- What is novel about your approach?

### 1.1 Motivation

Describe the real-world context and importance of the problem.

### 1.2 Contributions

List the main contributions of your work:
1. First contribution
2. Second contribution
3. Third contribution

---

## 2. Related Work

Survey previous research relevant to your work. Organize by:
- Different approaches to the problem
- Complementary methods
- Alternative solutions

### 2.1 Previous Approaches

Discuss earlier methods and their limitations.

### 2.2 Recent Advances

Highlight recent developments in the field.

---

## 3. Background

Provide necessary technical background for understanding your work.

### 3.1 Problem Formulation

Formally define the problem you're solving.

### 3.2 Preliminaries

Introduce key concepts, notation, and terminology.

---

## 4. Methodology

Describe your approach in detail.

### 4.1 Overview

Provide a high-level description of your method.

### 4.2 Model Architecture

Detail the technical components of your system.

### 4.3 Training Procedure

Explain how the model is trained.

### 4.4 Implementation Details

Provide reproducibility information:
- Hyperparameters
- Hardware requirements
- Software dependencies

---

## 5. Experiments

Present your experimental setup and results.

### 5.1 Datasets

Describe the datasets used for evaluation.

### 5.2 Evaluation Metrics

Define the metrics used to assess performance.

### 5.3 Baselines

List comparison methods.

### 5.4 Experimental Setup

Detail the experimental configuration.

---

## 6. Results

Present and analyze your findings.

### 6.1 Main Results

Report primary experimental results.

| Model | Dataset | Metric | Score |
|-------|---------|--------|-------|
| Baseline | Dataset A | Accuracy | 0.85 |
| Ours | Dataset A | Accuracy | 0.92 |

### 6.2 Ablation Studies

Analyze the contribution of different components.

### 6.3 Qualitative Analysis

Provide examples and case studies.

---

## 7. Discussion

Interpret your results and discuss implications.

### 7.1 Analysis

What do the results tell us?

### 7.2 Limitations

Acknowledge limitations of your approach.

### 7.3 Broader Impact

Discuss societal implications and potential applications.

---

## 8. Conclusion

Summarize your work and contributions.

### 8.1 Summary

Recap the main findings.

### 8.2 Future Work

Suggest directions for future research.

---

## Acknowledgments

Thank collaborators, funding sources, and computational resources.

---

## References

1. Author A, et al. "Paper Title." Conference/Journal, Year.
2. Author B, et al. "Another Paper." Conference/Journal, Year.

---

## Appendix

### A. Additional Experiments

Supplementary experimental results.

### B. Implementation Details

Code snippets and configuration details.

### C. Hyperparameters

Complete list of hyperparameters used.

```
