असंरचित उत्तरों का मार्गदर्शन

Llama 3 के साथ काम करना

Imtihan Ahmed

Machine Learning Engineer

मॉडल आउटपुट को नियंत्रित करना

  • ✅ Parameters
  • ✅ Roles

मॉडल को refine कैसे करें

Llama 3 के साथ काम करना

मॉडल आउटपुट को नियंत्रित करना

  • ✅ Parameters
  • ✅ Roles

मॉडल को refine कैसे करें - प्रॉम्प्ट्स refine करें

Llama 3 के साथ काम करना

मॉडल आउटपुट को नियंत्रित करना

  • ✅ Parameters
  • ✅ Roles

मॉडल को refine कैसे करें - zero-shot/few-shot prompting

Llama 3 के साथ काम करना

मॉडल आउटपुट को नियंत्रित करना

  • ✅ Parameters
  • ✅ Roles

मॉडल को refine कैसे करें - stop words का उपयोग

Llama 3 के साथ काम करना

प्रॉम्प्ट्स को refine करना

  • उदाहरण: summarization
text_choice1 = "Summarize key trends in the aviation industry from the last year, 
                focusing on fuel efficiency innovations."

text_choice2 = "Tell me about the aviation industry."
output = llm(text_choice1) # More specific prompt is more effective print(output['choices'][0]['text'])
The aviation industry has made significant strides in fuel efficiency innovations 
over the last year, driven by the need to reduce greenhouse gas emissions and 
operating costs. Sustainable Aviation Fuels (SAFs) have emerged as a key trend...
Llama 3 के साथ काम करना

प्रभावी prompting के घटक

प्रभावी prompting के घटक

Llama 3 के साथ काम करना

प्रभावी prompting के घटक

प्रभावी prompting के घटक - Precision

Llama 3 के साथ काम करना

प्रभावी prompting के घटक

प्रभावी prompting के घटक - ambiguity

Llama 3 के साथ काम करना

प्रभावी prompting के घटक

प्रभावी prompting के घटक - keywords

Llama 3 के साथ काम करना

प्रभावी prompting के घटक

प्रभावी prompting के घटक - action words

Llama 3 के साथ काम करना

प्रभावी prompting के घटक

प्रभावी prompting के घटक - examples

Llama 3 के साथ काम करना

Zero-shot prompting

  • Zero-shot prompting: एक ही निर्देश
text = "Summarize recent mergers in the airline industry."

output = llm(text) print(output['choices'][0]['text'])
Recent mergers in the airline industry include Alaska Air Group's acquisition of 
Hawaiian Airlines in 2024, with both airlines continuing to operate as separate 
brands. In 2022, Delta Air Lines purchased 20% of LATAM Airlines Group...
Llama 3 के साथ काम करना

Zero-shot प्रॉम्प्ट्स को refine करना

  • कार्य, अपेक्षित आउटपुट, और अतिरिक्त संदर्भ अलग-अलग बताने की ज़रूरत
  • लेबल्स के साथ zero-shot prompting
text = """
       INSTRUCTION: Write concisely and in 2-3 sentences that cover only key points.
       QUESTION: Summarize recent mergers in the airline industry.
       ANSWER:
       """
Llama 3 के साथ काम करना

Few-shot prompting

  • Few-shot prompting: कई उदाहरणों का उपयोग

प्रॉम्प्ट

Llama 3 के साथ काम करना

Few-shot prompting

  • Few-shot prompting: कई उदाहरणों का उपयोग

'aircraft model' हाइलाइट के साथ प्रॉम्प्ट

Llama 3 के साथ काम करना

Few-shot prompting

  • Few-shot prompting: कई उदाहरणों का उपयोग

'passenger capacity' हाइलाइट के साथ प्रॉम्प्ट

Llama 3 के साथ काम करना

Few-shot prompting

  • Few-shot prompting: कई उदाहरणों का उपयोग

'fuel consumption' हाइलाइट के साथ प्रॉम्प्ट

Llama 3 के साथ काम करना

Few-shot prompting

$$

output = llm(f"Continue the entries: {text}") 

print(output['choices'][0]['text'])
Aircraft Model: Airbus A350-900
Passenger Capacity: 350
Fuel Consumption: 2.39 liters per seat per 100 km
Llama 3 के साथ काम करना

Stop words का उपयोग

  • संक्षिप्त insights चाहिए
  • जवाब को किसी बिंदु पर रोकने हेतु stop words का उपयोग करें
  • उदाहरण: question-answering एप्लिकेशन
text = "Which airlines operate direct flights from London to Singapore?"


output = llm(text, stop=["Q:"]) # Stop responses at "Q:"
print(output['choices'][0]['text'])
You can fly direct from London to Singapore with Singapore Airlines and 
British Airways.
Llama 3 के साथ काम करना

अभ्यास करते हैं!

Llama 3 के साथ काम करना

Preparing Video For Download...