> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monostate.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Choosing Your Approach

> Decide between fine-tuning, training from scratch, or prompt engineering

# Choosing Your Training Approach

Not every AI problem needs the same solution. Sometimes you need full training, sometimes just fine-tuning, and sometimes no training at all.

## The Three Approaches

<CardGroup cols={3}>
  <Card title="Prompt Engineering">
    **No training needed**

    Use existing models with clever prompts

    * Instant results
    * Zero training cost
    * 0-10 examples needed
  </Card>

  <Card title="Fine-Tuning">
    **Recommended approach**

    Adapt pre-trained models to your needs

    * Consistent behavior
    * 100-10K examples
    * Hours to days
  </Card>

  <Card title="Training from Scratch">
    **Rarely needed**

    Build completely new models

    * Full control
    * Millions of examples
    * Very expensive
  </Card>
</CardGroup>

### 1. Prompt Engineering (No Training)

Use existing models with carefully crafted prompts.

**What it is**: Writing instructions that get the model to do what you want without any training.

**Example**:

```
You are a customer service agent for TechCorp.
Always be polite and helpful.
Product return policy: 30 days with receipt.

Customer: Can I return my laptop?
```

**When to use**:

* Testing ideas quickly
* Few examples available
* Task is within model's capabilities
* Budget/time constraints

**Pros**:

* Zero training time
* No training data needed
* Instant results
* Free to try

**Cons**:

* Limited customization
* Inconsistent results
* Can't add new knowledge
* Higher inference cost

### 2. Fine-Tuning (Recommended)

Adapt a pre-trained model to your specific needs.

**What it is**: Taking a model that already understands language/images and teaching it your specific task.

**When to use**:

* Have hundreds to thousands of examples
* Need consistent behavior
* Want to add domain knowledge
* Building production systems

**Pros**:

* Faster than training from scratch
* Needs less data
* Better performance than prompting
* Lower inference cost than prompting

**Cons**:

* Requires training data
* Needs compute resources
* Takes time to train
* Can overfit on small datasets

### 3. Training from Scratch

Build a completely new model.

**What it is**: Starting with random weights and training on massive datasets.

**When to use**:

* Creating foundational models
* Completely novel architectures
* Unlimited data and compute
* Research purposes

**Pros**:

* Full control
* Can create novel capabilities
* No inherited biases

**Cons**:

* Needs massive data (millions of examples)
* Extremely expensive
* Takes weeks to months
* Usually unnecessary

## Decision Framework

### Quick Decision Guide

<Steps>
  <Step title="Check your data">
    Do you have training examples?

    * **No** → Go with Prompt Engineering
    * **Yes** → Continue to Step 2
  </Step>

  <Step title="Count your examples">
    How many examples do you have?

    * **Less than 100** → Use Prompt Engineering
    * **100-10,000** → Perfect for Fine-tuning
    * **Millions** → Could train from scratch (but why?)
  </Step>

  <Step title="Evaluate your needs">
    What's most important?

    * **Speed to deploy** → Prompt Engineering
    * **Consistent behavior** → Fine-tuning
    * **Novel architecture** → Training from scratch
  </Step>
</Steps>

### Detailed Comparison

| Aspect             | Prompt Engineering | Fine-Tuning          | Training from Scratch |
| ------------------ | ------------------ | -------------------- | --------------------- |
| **Data Needed**    | 0-10 examples      | 100-10,000 examples  | Millions of examples  |
| **Time to Deploy** | Minutes            | Hours to days        | Weeks to months       |
| **Cost**           | \$0 upfront        | \$10-1,000           | \$10,000+             |
| **Customization**  | Limited            | High                 | Complete              |
| **New Knowledge**  | No                 | Yes                  | Yes                   |
| **Consistency**    | Variable           | High                 | High                  |
| **Maintenance**    | Update prompts     | Retrain periodically | Continuous training   |

## Approach by Use Case

<Tabs>
  <Tab title="Customer Service">
    <Card>
      **When to use Prompt Engineering:**

      * General FAQs
      * Simple routing
      * Low volume
      * Testing phase

      **When to use Fine-Tuning:**

      * Company knowledge
      * Brand voice
      * High volume
      * Complex products
    </Card>
  </Tab>

  <Tab title="Content Generation">
    <Card>
      **When to use Prompt Engineering:**

      * Blog posts
      * Creative writing
      * Varied formats
      * Experimentation

      **When to use Fine-Tuning:**

      * Brand consistency
      * Technical content
      * SEO optimization
      * Style guide adherence
    </Card>
  </Tab>

  <Tab title="Code Generation">
    <Card>
      **When to use Prompt Engineering:**

      * General coding
      * Multiple languages
      * Learning/prototyping
      * Open source

      **When to use Fine-Tuning:**

      * Company standards
      * Custom frameworks
      * Domain languages
      * Security patterns
    </Card>
  </Tab>

  <Tab title="Document Analysis">
    <Card>
      **When to use Prompt Engineering:**

      * Standard formats
      * Basic extraction
      * Low accuracy OK
      * One-off tasks

      **When to use Fine-Tuning:**

      * Custom formats
      * High accuracy
      * Legal/medical
      * Compliance needs
    </Card>
  </Tab>
</Tabs>

## Fine-Tuning Methods

<CardGroup cols={2}>
  <Card title="Standard Fine-Tuning">
    **Update all parameters**

    Pros:

    * Maximum accuracy

    Cons:

    * Needs more memory

    Best for: Production systems with good GPUs
  </Card>

  <Card title="LoRA">
    **Low-Rank Adaptation**

    Pros:

    * 90% less memory
    * Swap adapters
    * Faster training

    Best for: Large models, limited resources
  </Card>

  <Card title="QLoRA">
    **Quantized LoRA**

    Pros:

    * Works on consumer GPUs
    * 4-bit quantization

    Cons:

    * Slightly lower accuracy

    Best for: Experimentation, very limited resources
  </Card>

  <Card title="Prompt/Prefix Tuning">
    **Train only prompts**

    Pros:

    * Minimal memory
    * Very fast

    Cons:

    * Limited capacity

    Best for: Few-shot learning, multiple tasks
  </Card>
</CardGroup>

## Progressive Approach

<Steps>
  <Step title="Stage 1: Prompt Engineering">
    **Start simple, test fast**

    * Test the concept
    * Gather user feedback
    * Identify limitations
    * Collect training data
  </Step>

  <Step title="Stage 2: Few-Shot Fine-Tuning">
    **Improve with examples**

    * Use collected examples
    * Improve consistency
    * Reduce prompt complexity
    * Validate approach
  </Step>

  <Step title="Stage 3: Full Fine-Tuning">
    **Scale for production**

    * Scale with more data
    * Optimize performance
    * Reduce inference costs
    * Production deployment
  </Step>

  <Step title="Stage 4: Continuous Improvement">
    **Keep getting better**

    * Collect production data
    * Periodic retraining
    * A/B testing
    * Performance monitoring
  </Step>
</Steps>

## Cost Considerations

<AccordionGroup>
  <Accordion title="Prompt Engineering">
    **Training Cost**: \$0

    **Inference**: \$0.01-0.10 per 1K tokens

    **Best for**: Low volume, experimentation

    Monthly estimate (1M tokens): \$10-100
  </Accordion>

  <Accordion title="Fine-Tuning">
    **Training Cost**: \$10-1,000 (one-time)

    **Inference**: \$0.001-0.01 per 1K tokens

    **Best for**: High volume, production

    Monthly estimate (1M tokens): \$1-10 + hosting
  </Accordion>

  <Accordion title="Training from Scratch">
    **Training Cost**: \$10,000-millions

    **Inference**: Variable based on size

    **Best for**: Foundation model creators

    Not recommended unless you're OpenAI/Google
  </Accordion>
</AccordionGroup>

## Data Requirements

### Prompt Engineering

* **Minimum**: Zero-shot (no examples)
* **Better**: Few-shot (3-5 examples)
* **Best**: Many-shot (10+ examples in context)

### Fine-Tuning

* **Minimum**: 50-100 examples
* **Better**: 500-1,000 examples
* **Best**: 5,000+ examples

### Training from Scratch

* **Minimum**: 1M+ examples
* **Better**: 100M+ examples
* **Best**: Billions of examples

## Quality vs Quantity Trade-offs

### High Quality, Low Quantity

→ **Fine-tune with careful data curation**

* Hand-picked examples
* Expert annotations
* Data augmentation

### Low Quality, High Quantity

→ **Use larger models with filtering**

* Automated cleaning
* Statistical filtering
* Ensemble methods

### Mixed Quality

→ **Progressive filtering approach**

* Start with all data
* Identify quality indicators
* Weight by quality

## Common Mistakes to Avoid

<Warning>
  **Jumping to Training Too Fast**

  Always try prompt engineering first. You might not need training at all.
</Warning>

<Warning>
  **Insufficient Training Data**

  Fine-tuning with 10 examples won't work. Need at least 100 quality examples.
</Warning>

<Warning>
  **Over-Engineering Solutions**

  Don't train from scratch for standard tasks. Use pre-trained models.
</Warning>

<Warning>
  **Ignoring Maintenance**

  Models need updates. Plan for retraining from day one.
</Warning>

## Hybrid Approaches

### RAG (Retrieval Augmented Generation)

Combine prompting with external knowledge.

**Use when**:

* Need updatable knowledge
* Can't fine-tune frequently
* Have structured data

### Ensemble Methods

Combine multiple approaches.

**Example**:

* Prompt for creativity
* Fine-tuned model for accuracy
* Vote/combine outputs

### Chain of Thought + Fine-Tuning

Fine-tune on reasoning steps.

**Use when**:

* Need explainable outputs
* Complex reasoning tasks
* Educational applications

## Making the Decision

### Questions to Ask

1. **What's my budget?**
   * Low → Prompt engineering
   * Medium → Fine-tuning
   * High → Consider all options

2. **How much data do I have?**
   * Less than 100 examples → Prompt engineering
   * 100-10K → Fine-tuning
   * More than 1M → Could train from scratch

3. **How unique is my task?**
   * Common → Prompt engineering
   * Specialized → Fine-tuning
   * Novel → Training from scratch

4. **What accuracy do I need?**
   * Acceptable → Prompt engineering
   * High → Fine-tuning
   * Perfect → Multiple iterations

5. **How fast do I need results?**
   * Today → Prompt engineering
   * This week → Fine-tuning
   * This quarter → Any approach

## Next Steps

Ready to start training?

<CardGroup cols={3}>
  <Card title="Quick Start" href="/foundations/quickstart">
    Try your first model
  </Card>

  <Card title="Choose Interface" href="/foundations/choosing-interface">
    Pick UI, CLI, or API
  </Card>

  <Card title="Model Types" href="/foundations/model-types">
    Select architecture
  </Card>
</CardGroup>
