کانتکست، پرامپت و یادگیری درونمتنی
هوش مصنوعی برای همه: هوش مصنوعی چطور باهوش شد؟
- A context window as the bounded input available for a particular model call.
- Instructions, examples, conversation history, and supplied documents as different context contents.
- In-context learning as adapting behavior from examples without updating model parameters.
- Context limits, truncation, and why a longer window does not ensure perfect use of every detail.
- A simple prompt structure using a task, relevant evidence, constraints, and an output format.
- The difference between visible conversation history, application-managed memory, and model training.
- Why requesting explanations can help inspect an answer but cannot establish that its account faithfully reveals internal computation.
چه چیزی در دسترس مدل است؟
```svg
<svg viewBox="0 0 800 450" xmlns="http://www.w3.org/2000/svg"><defs><marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto"><path d="M0,0 L0,6 L9,3 z" class="tm-arrow"/></marker></defs><rect x="36" y="58" width="190" height="90" rx="14" class="tm-surface"/><text x="131" y="96" class="tm-text" font-size="18" text-anchor="middle" direction="rtl">دفترچهٔ پمپ</text><text x="131" y="124" class="tm-text2" font-size="16" text-anchor="middle" direction="rtl">فیلتر: ۲۰۰ ساعت</text><rect x="310" y="58" width="170" height="90" rx="14" class="tm-soft"/><text x="395" y="96" class="tm-text" font-size="18" text-anchor="middle" direction="rtl">فایل روی دستگاه</text><text x="395" y="124" class="tm-muted" font-size="15" text-anchor="middle" direction="rtl">هنوز نرسیده</text><rect x="574" y="58" width="190" height="90" rx="14" class="tm-surface"/><text x="669" y="96" class="tm-text" font-size="18" text-anchor="middle" direction="rtl">مدل</text><text x="669" y="124" class="tm-muted" font-size="15" text-anchor="middle" direction="rtl">پرسش تنها</text><path d="M226 103 H300" class="tm-line" marker-end="url(#arrow)"/><path d="M480 103 H564" class="tm-line" marker-end="url(#arrow)"/><rect x="300" y="220" width="200" height="100" rx="16" class="tm-accent"/><text x="400" y="260" class="tm-text" font-size="20" text-anchor="middle">context</text><text x="400" y="290" class="tm-text2" font-size="16" text-anchor="middle" direction="rtl">ورودی همین نوبت</text><text x="400" y="380" class="tm-muted" font-size="15" text-anchor="middle" direction="rtl">دسترسی مدل محدود به ورودی است</text><rect x="36" y="58" width="190" height="90" rx="14" class="tm-accent tm-pulse"/><text x="131" y="96" class="tm-text" font-size="18" text-anchor="middle" direction="rtl">دفترچهٔ پمپ</text><text x="131" y="124" class="tm-text2" font-size="16" text-anchor="middle" direction="rtl">فیلتر: ۲۰۰ ساعت</text><path d="M226 103 H300" class="tm-line-accent tm-flow" marker-end="url(#arrow)"/><rect x="310" y="58" width="170" height="90" rx="14" class="tm-accent tm-enter"/><text x="395" y="96" class="tm-text" font-size="18" text-anchor="middle" direction="rtl">فایل روی دستگاه</text><text x="395" y="124" class="tm-text2" font-size="15" text-anchor="middle" direction="rtl">باید وارد شود</text><rect x="574" y="58" width="190" height="90" rx="14" class="tm-surface"/><text x="669" y="96" class="tm-text" font-size="18" text-anchor="middle" direction="rtl">مدل</text><text x="669" y="124" class="tm-muted" font-size="15" text-anchor="middle" direction="rtl">فقط متن ورودی</text><path d="M480 103 H564" class="tm-line-accent" marker-end="url(#arrow)"/><rect x="300" y="220" width="200" height="100" rx="16" class="tm-accent"/><text x="400" y="260" class="tm-text" font-size="20" text-anchor="middle">context</text><text x="400" y="290" class="tm-text2" font-size="16" text-anchor="middle" direction="rtl">ورودی همین نوبت</text><text x="400" y="380" class="tm-muted" font-size="15" text-anchor="middle" direction="rtl">دسترسی مدل محدود به ورودی است</text></svg>
```
یادگیری درونمتنی با نمونه
```svg
<svg viewBox="0 0 800 450" xmlns="http://www.w3.org/2000/svg"><defs><marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto"><path d="M0,0 L0,6 L9,3 z" class="tm-arrow"/></marker></defs><rect x="45" y="70" width="310" height="280" rx="14" class="tm-soft"/><text x="200" y="105" class="tm-text" font-size="20" text-anchor="middle" direction="rtl">نمونه در prompt</text><rect x="80" y="135" width="240" height="64" rx="10" class="tm-surface"/><text x="200" y="162" class="tm-text2" font-size="15" text-anchor="middle" direction="rtl">چراغ سبز یعنی چی؟</text><text x="200" y="184" class="tm-muted" font-size="14" text-anchor="middle" direction="rtl">وضعیت: آماده؛ شاهد: جملهٔ نمونه</text><rect x="445" y="70" width="310" height="280" rx="14" class="tm-soft"/><text x="600" y="105" class="tm-text" font-size="20" text-anchor="middle" direction="rtl">متن واقعی</text><rect x="480" y="135" width="240" height="64" rx="10" class="tm-surface"/><text x="600" y="162" class="tm-text2" font-size="15" text-anchor="middle" direction="rtl">زمان تعویض فیلتر؟</text><text x="600" y="184" class="tm-muted" font-size="14" text-anchor="middle" direction="rtl">فیلتر پس از ۲۰۰ ساعت</text><path d="M320 230 C390 230 410 230 480 230" fill="none" class="tm-line-accent" stroke-width="3" marker-end="url(#arrow)"/><rect x="485" y="250" width="230" height="66" rx="10" class="tm-accent"/><text x="600" y="277" class="tm-text" font-size="15" text-anchor="middle" direction="rtl">زمان تعویض: ۲۰۰ ساعت</text><text x="600" y="301" class="tm-text" font-size="14" text-anchor="middle" direction="rtl">شاهد: متن واقعی</text><text x="400" y="395" class="tm-text-accent" font-size="18" text-anchor="middle" direction="rtl">الگو منتقل میشود؛ مدرک نمونه نه</text><rect x="280" y="20" width="240" height="34" rx="17" class="tm-gold"/><text x="400" y="43" class="tm-text" font-size="15" text-anchor="middle" direction="rtl">پارامترها ثابت؛ بدون training دوباره</text></svg>
```
ساخت prompt مبتنی بر مدرک
متن دفترچه: حداکثر فشار کاری شش bar؛ فیلتر بعد از دویست ساعت کار تعویض شود. هدف: استخراج فشار، زمان تعویض و دمای آب.
**کار**
\[ \text{استخراج فشار، زمان تعویض فیلتر، دمای آب} \]
مشخص کن دقیقاً چه میخواهی.
**شواهد**
\[ \text{متن دفترچه: فشار کاری شش bar؛ تعویض فیلتر بعد از دویست ساعت} \]
مدرک را از درخواست جدا کن.
**محدودیت**
\[ \text{فقط همین متن؛ مورد ناموجود: در متن نیومده؛ نقل شاهد} \]
از اطلاعات دیگر پمپها استفاده نکن.
**قالب خروجی**
\[ \text{ویژگی، پاسخ، شاهد} \]
برای هر مورد همین سه بخش را بنویس.
**پاسخ: فشار کاری**
\[ \text{حداکثر فشار کاری} \;|\; \text{شش bar} \;|\; \text{حداکثر فشار کاری شش bar} \]
پاسخ همراه با عبارت پشتیبان.
**پاسخ: فیلتر**
\[ \text{زمان تعویض فیلتر} \;|\; \text{بعد از دویست ساعت کار} \;|\; \text{فیلتر بعد از دویست ساعت کار تعویض بشه} \]
شاهد را از متن نقل کن.
**پاسخ: دما**
\[ \text{حداکثر دمای آب} \;|\; \text{در متن نیومده} \;|\; \text{شاهدی در متن نیست} \]
نبودن اطلاعات، نبودن محدودیت دما را ثابت نمیکند.
**آزمون حذف**
\[ \text{حذف جملهٔ فیلتر} \Rightarrow \text{زمان تعویض: در متن نیومده} \]
از گفتوگوی قبلی عددی را وارد نکن.
ظرفیت، نه تضمین
```svg
<svg viewBox="0 0 800 450" xmlns="http://www.w3.org/2000/svg"><defs><marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto"><path d="M0,0 L0,6 L9,3 z" class="tm-arrow"/></marker></defs><text x="400" y="42" class="tm-text" font-size="20" text-anchor="middle" direction="rtl">متن مرتبط و کافی</text><rect x="72" y="82" width="656" height="260" rx="16" class="tm-surface"/><text x="400" y="115" class="tm-muted" font-size="16" text-anchor="middle" direction="rtl">ورودی مدل</text><rect x="102" y="145" width="250" height="54" rx="9" class="tm-green"/><text x="227" y="179" class="tm-text" font-size="16" text-anchor="middle" direction="rtl">نگهداری همین پمپ</text><rect x="378" y="145" width="250" height="54" rx="9" class="tm-green"/><text x="503" y="179" class="tm-text" font-size="16" text-anchor="middle" direction="rtl">نام دستگاه</text><rect x="102" y="220" width="526" height="54" rx="9" class="tm-gold"/><text x="365" y="254" class="tm-text" font-size="16" text-anchor="middle" direction="rtl">محیط پرگردوغبار: زودتر بررسی کن</text><text x="400" y="390" class="tm-text-green" font-size="17" text-anchor="middle" direction="rtl">ظرفیت بیشتر، تضمین توجه بینقص نیست</text><text x="400" y="418" class="tm-muted" font-size="14" text-anchor="middle" direction="rtl">مرزهای روشن؛ نه کوتاهترین متن</text></svg>
```
حافظه با یادگیری یکی نیست
```svg
<svg viewBox="0 0 800 450" xmlns="http://www.w3.org/2000/svg"><defs><marker id="arrow" markerWidth="10" markerHeight="10" refX="8" refY="3" orient="auto"><path d="M0,0 L0,6 L9,3 z" class="tm-arrow"/></marker></defs><rect x="45" y="55" width="210" height="120" rx="14" class="tm-surface"/><text x="150" y="100" class="tm-text" font-size="20" text-anchor="middle" direction="rtl">تاریخچهٔ قابلدیدن</text><text x="150" y="135" class="tm-muted" font-size="16" text-anchor="middle" direction="rtl">پیامهای گفتوگو</text><rect x="295" y="55" width="210" height="120" rx="14" class="tm-surface"/><text x="400" y="100" class="tm-text" font-size="20" text-anchor="middle" direction="rtl">حافظهٔ برنامه</text><text x="400" y="135" class="tm-muted" font-size="16" text-anchor="middle" direction="rtl">ذخیره بیرون از مدل</text><rect x="545" y="55" width="210" height="120" rx="14" class="tm-accent"/><text x="650" y="100" class="tm-text" font-size="20" text-anchor="middle">training</text><text x="650" y="135" class="tm-text2" font-size="16" text-anchor="middle" direction="rtl">تغییر پارامترها</text><rect x="295" y="235" width="210" height="90" rx="14" class="tm-surface"/><text x="400" y="273" class="tm-text" font-size="18" text-anchor="middle" direction="rtl">جملهٔ تعویض فیلتر</text><text x="400" y="300" class="tm-muted" font-size="15" text-anchor="middle" direction="rtl">ذخیرهشده</text><rect x="295" y="365" width="210" height="60" rx="14" class="tm-surface"/><text x="400" y="402" class="tm-text" font-size="17" text-anchor="middle" direction="rtl">context و پاسخ</text><path d="M505 280 C550 280 570 190 650 175" class="tm-line" marker-end="url(#arrow)"/><text x="600" y="245" class="tm-muted" font-size="15" text-anchor="middle" direction="rtl">جدا از</text></svg>
```
بازگشت به دوره