• LLM से सटीक और उपयुक्त output पाने के लिए परिष्कृत prompt design आवश्यक है
  • Prompt design, machine learning से परिचित न होने वाले users को भी न्यूनतम overhead के साथ model output नियंत्रित करने में सक्षम बनाता है
  • Uber ने LLM पर तेज़ी से iterative experiments करने के लिए एक centralized toolkit विकसित किया
    • Prompt templates का creation और management
    • RAG और runtime datasets का उपयोग
  • फीचर्स:
    • System instructions, dynamic contextualization, large-scale offline generation (LLM inference), response evaluation का समर्थन
    • Version control, collaboration, safety checks (hallucination checks, standard evaluation framework, safety policies सहित)

Prompt Engineering Lifecycle

Prompt engineering lifecycle दो चरणों से बना है:

  • Development चरण: LLM exploration, prompt template iteration, और evaluation के 3 चरण
    • LLM exploration चरण: model catalog और GenAI Playground के माध्यम से उपलब्ध LLMs को explore करना और prompts से LLM responses को test करना
    • Prompt template iteration चरण: विशिष्ट business requirements समझना, sample data एकत्र करना, prompt बनाना/विश्लेषण करना/test करना, response evaluate करना और आवश्यकता अनुसार संशोधन करना। Auto-prompting के ज़रिए शुरुआत से prompt template बनाने की ज़रूरत नहीं
    • Evaluation चरण: बड़े datasets के साथ prompt templates को test करके performance मापना। LLM को judge की तरह या custom code-based LLM evaluator के रूप में उपयोग करके performance evaluate की जा सकती है
  • Productionization चरण: केवल वे prompt templates production में ले जाए जाते हैं जो evaluation चरण में threshold पार करते हैं। Production environment में usage को track/monitor किया जाता है और system usage data एकत्र कर process सुधार में उपयोग किया जाता है

Architecture

  • Prompt template UI/SDK: prompt templates और revisions का management। GetAPI, Execute API के साथ integration
  • LLM model catalog: deployed LLM models के साथ interface
  • Models और prompts को ETCD और UCS में store किया जाता है और offline generation pipeline तथा prompt template evaluation pipeline में उपयोग किया जाता है

Prompt Template Creation

  • Prompt toolkit का prompt builder users के लिए prompts अपने आप generate करता है
  • यह किसी विशिष्ट AI use case के लिए उपयुक्त advanced prompting techniques खोजने में मदद करता है
  • LangChain-आधारित internal Langfx framework का उपयोग करने वाला auto prompt builder निम्न चरणों का पालन करता है
    • 1. Prompt engineering best practices का integration
    • 2. Prompt generation में मदद के लिए template listing, विस्तृत instructions और कुछ examples प्रदान करना
    • 3. Prompt generation को support करने के लिए LLM models का उपयोग
  • Advanced prompt guidelines: prompt builder नीचे दिए गए सिद्धांतों का उपयोग करके prompts बनाता है
    • CoT(Chain of Thought) prompting: intermediate reasoning steps के माध्यम से complex reasoning सक्षम करना
    • Auto-CoT: leading words "think step by step" का उपयोग। Manual effort हटाने के लिए LLM को "Let's think step by step" prompt देना
    • Prompt chaining: ऐसे scenarios में उपयोगी जहाँ कई tasks या transformations शामिल हों
    • ToT(Tree of Thought): Chain-of-thought prompting का सामान्यीकरण और language model को general problem solving के intermediate steps के रूप में विचारों की खोज के लिए प्रोत्साहित करना
    • APE(Automatic Prompt Engineering): instruction generation और selection को automate करने वाला framework
    • Multimodal CoT prompting: text और images को 2-step framework में integrate करना। चरण 1 में multimodal information के आधार पर rationale generation, चरण 2 में generated rationale का उपयोग कर answer reasoning
  • Revision management
    • Prompt template iteration, code-based iteration best practices का पालन करती है
    • Test responses और datasets पर testing के लिए users instructions और model parameters बदल सकते हैं
    • Prompt template की हर iteration पर code review आवश्यक है। Approval और merge के बाद नया prompt template revision बनता है

Prompt Template Evaluation

Prompt template performance का मूल्यांकन करने के लिए कई components मिलकर काम करते हैं:

  • दो evaluation mechanisms
    • LLM को evaluator की तरह उपयोग करना। उन tasks के लिए उपयोगी जहाँ subjective quality या linguistic nuance महत्वपूर्ण हो
    • Custom user-defined code से performance evaluate करना। Performance के विशिष्ट पहलुओं को मापने में उपयोगी
  • Evaluation prompt template: evaluation के लिए instructions, सरल examples, metrics, response format आदि देने वाला user-friendly template
  • Actual prompt template: production में इस्तेमाल होने वाला template। Runtime पर hydrate किया जाता है और performance evaluation में उपयोग होता है
  • Input dataset options: labeled golden dataset या production traffic से निकला dataset
  • हर template का evaluation विशिष्ट instructions, context, संबंधित model और parameters को ध्यान में रखकर किया जाता है

Uber में Use Cases

Offline LLM Service

LLM batch offline generation pipeline, बड़े पैमाने पर LLM response generation के लिए batch inference को आसान बनाती है:

  • Consumer username verification use case में उपयोग संभव
  • MA Studio में केवल संबंधित dataset चुनना और input देना होता है
  • Prompt template को dataset के साथ dynamically hydrate किया जाता है

Online LLM Service

Prompt templates में dynamic placeholders शामिल होते हैं जिन्हें runtime-specific values से बदला जाना चाहिए:

  • वर्तमान में Jinja-आधारित template syntax का उपयोग कर केवल string-type substitution समर्थित है
  • Prompt, template और model के बीच fan-out capability का समर्थन
    • Template: API templates में general data model से expose किए गए payload को vendor-specific API structure में format करने की क्षमता शामिल है
    • Prompt और model: prompt किसी specific model और template से बँधा होता है। Service prompt को fetch करती है और आवश्यक model तथा template parameters के साथ genAI API को call करके execute करती है

इन फीचर्स को एक summarization use case से समझा जा सकता है:

  • Support ticket(contact) को कई agents द्वारा संभाले जाने वाले scenario में नया agent context समझने के लिए ticket देखता है या customer से समस्या दोबारा समझाने को कहता है
  • Agents के बीच handoff के समय summary देकर इस समस्या को हल किया जाता है

Monitoring

Monitoring, production में उपयोग हो रहे production prompt templates की performance मापती है:

  • Daily performance monitoring pipeline, production traffic पर performance evaluation चलाती है
  • Latency, accuracy, correctness जैसे metrics को prompt template की हर production iteration के लिए monitor किया जाता है
  • MES dashboard को performance monitoring metrics के साथ रोज़ refresh किया जाता है

निष्कर्ष

Uber का prompt engineering toolkit, development और production के विभिन्न चरणों में LLM के साथ interaction और उपयोग को बेहतर बनाने के लिए एक comprehensive framework है:

  • Gen AI Playground में LLM capabilities की शुरुआती exploration से लेकर detailed prompt template iteration और generation तक समर्थन
  • Toolkit की architecture, advanced guideline techniques और robust evaluation methods को integrate करके prompt design के लिए एक systematic approach प्रदान करती है
  • Prompt templates के development से production usage और monitoring तक का structured lifecycle सुनिश्चित करता है कि हर template का कड़ाई से परीक्षण हो और उसे performance के लिए optimize किया जाए
  • भविष्य में online evaluation और evaluation के लिए RAG तथा offline generation के लिए RAG के साथ integration की योजना है

अभी कोई टिप्पणी नहीं है.

अभी कोई टिप्पणी नहीं है.