Skip to the content.

Use Cases

Explore real-world applications for fine-tuned language models with LoRA Craft.


Math & Science Education

Train models to solve mathematical problems, explain scientific concepts, and provide step-by-step reasoning.

Example Application: Math Tutoring Assistant

The Challenge: Students need help with math homework but want detailed explanations, not just answers. Generic LLMs often skip steps or make calculation errors.

The Solution: Fine-tune a model on math problem datasets with a reward function that values:

Model: Qwen3 1.5B or Llama 3.2 3B

Dataset Options:

Reward Function: Math & Science

Training Tips:

Expected Results

Before Fine-tuning:

Q: If a shirt costs $25 and is on sale for 20% off, what's the final price?
A: The final price would be around $20.

After Fine-tuning:

Q: If a shirt costs $25 and is on sale for 20% off, what's the final price?

A: <start_working_out>
Original price: $25
Discount: 20% of $25 = 0.20 × $25 = $5
Final price: $25 - $5 = $20
<end_working_out>

<SOLUTION>$20</SOLUTION>

Real-World Applications


Code Generation & Programming

Create AI coding assistants that generate clean, efficient code with proper documentation.

Example Application: Python Code Assistant

The Challenge: Developers need code snippets that are not only syntactically correct but also follow best practices, include error handling, and are well-documented.

The Solution: Fine-tune on code datasets with rewards for:

Model: Qwen3 3B or Mistral 7B

Dataset Options:

Reward Function: Code Generation or Programming

Training Tips:

Expected Results

Before Fine-tuning:

def read_file(path):
    f = open(path)
    data = f.read()
    return data

After Fine-tuning:

def read_file(path: str) -> str:
    """
    Read and return the contents of a file.

    Args:
        path: Path to the file to read

    Returns:
        File contents as a string

    Raises:
        FileNotFoundError: If the file doesn't exist
        IOError: If there's an error reading the file
    """
    try:
        with open(path, 'r', encoding='utf-8') as f:
            return f.read()
    except FileNotFoundError:
        raise FileNotFoundError(f"File not found: {path}")
    except IOError as e:
        raise IOError(f"Error reading file {path}: {e}")

Real-World Applications


Question Answering Systems

Build specialized Q&A models for specific domains with accurate, relevant answers.

Example Application: Customer Support Bot

The Challenge: Customer support teams need to answer repetitive questions quickly while maintaining accuracy and helpful tone.

The Solution: Fine-tune on your FAQ data and support tickets with rewards for:

Model: Llama 3.2 3B or Qwen3 1.5B

Dataset Options:

Reward Function: Question Answering

Training Tips:

Expected Results

Before Fine-tuning:

Q: What's your return policy?
A: You can return items. Check our website for more details.

After Fine-tuning:

Q: What's your return policy?
A: We offer a 30-day return window for unused items in original packaging.
To initiate a return:
1. Log into your account
2. Go to Order History
3. Select the item and click "Return"
4. Print the prepaid shipping label

Refunds are processed within 5-7 business days of receiving the return.
For damaged or defective items, returns are accepted beyond 30 days.

Real-World Applications


Custom Domain Applications

Fine-tune for specialized tasks with custom reward functions and datasets.

Example 1: Medical Report Summarization

Application: Summarize lengthy medical reports for doctors.

Configuration:

Key Metrics:

Application: Extract key clauses and obligations from contracts.

Configuration:

Key Metrics:

Example 3: Creative Content Generation

Application: Generate marketing copy with specific brand voice.

Configuration:

Key Metrics:

Example 4: Language Translation

Application: Domain-specific translation (technical, medical, legal).

Configuration:

Key Metrics:


Building Custom Reward Functions

For specialized applications, you’ll need custom reward functions. Here’s how:

1. Define Success Criteria

What makes a “good” output for your task?

2. Implement Reward Logic

Example: Product description generator

def product_description_reward(response, reference_data):
    score = 0.0

    # Check length (100-200 words ideal)
    word_count = len(response.split())
    if 100 <= word_count <= 200:
        score += 0.3

    # Check for required elements
    required_elements = ['features', 'benefits', 'use case']
    for element in required_elements:
        if element.lower() in response.lower():
            score += 0.2

    # Check sentiment (should be positive)
    sentiment = analyze_sentiment(response)  # Custom function
    if sentiment > 0.5:
        score += 0.3

    return min(score, 1.0)

3. Test Thoroughly

Before training:

4. Iterate Based on Results

After training:


Getting Started with Your Use Case

1. Define Your Task

2. Gather Data

3. Choose Starting Point

4. Iterate Quickly

5. Measure Success

Define metrics before training:


Need Help with Your Use Case?

Have a success story? We’d love to hear it! Share your results in our community discussions.