AI Scope
135 subscribers
193 photos
21 videos
18 files
113 links
Download Telegram
نرخ یادگیری؛ اندازه قدم‌ها برای اصلاح

وقتی وزن‌ها رو تغییر می‌دیم، باید میزان تغییر رو کنترل کنیم. این همون چیزی‌یه که بهش می‌گیم نرخ یادگیری (η):

⚫️اگه زیاد باشه شبکه ممکنه مسیر رو اشتباه بره و نره سر جای درست.

⚪️اگه کم باشه آموزش خیلی آهسته پیش می‌ره

روش‌های مدرن مثل Adam یا RMSProp این مقدار رو به صورت هوشمند تنظیم می‌کنن تا هم سرعت مناسب باشه هم پایدار.

The Learning Rate — The Dial of Progress

When updating weights, we don’t apply the raw gradient. We multiply it by a small constant: the learning rate (η).

Too high → the network overshoots, oscillates, or fails to converge.

Too low → training crawls, maybe never reaching a good solution.

Tuning the learning rate is both an art and a science. Modern optimizers (Adam, RMSProp, etc.) adapt it dynamically.


🦴 @scopeofai | #concepts
ساخت اولین شبکه عصبی (پرسیپترون)

ساده‌ترین شبکه عصبی پرسیپترونه: دو ورودی و یک خروجی.

مثل یاد دادن دروازه منطقی OR یا AND به ماشین. همه ورودی‌ها به شبکه داده می‌شن، خروجی با جواب مقایسه می‌شه، وزن‌ها تغییر می‌کنن تا جدول درست پیاده بشه.

اینجا کل چرخه یادگیری رو در کوچک‌ترین مقیاس می‌بینیم:
ورودی ⬅️ جمع وزنی ⬅️ تابع فعال‌سازی ⬅️ خروجی ⬅️ خطا ⬅️ به‌روزرسانی وزن‌ها.

با کنار هم گذاشتن چند پرسیپترون ساده، به شبکه‌های چندلایه (MLP) می‌رسیم که می‌تونن تقریباً هر تابعی رو مدل کنن.

Building Our First Neural Network (Perceptron)

The simplest neural network is the Perceptron. Imagine two inputs feeding into one output neuron.

Training it on logic gates (like OR/AND) is the classic exercise. You feed in all possible inputs, compare the output to the truth table, and adjust weights until the perceptron reproduces the logic perfectly.

This shows the full learning cycle in miniature:

Inputs → weighted sum → activation → output → error → weight update.

From here, stacking multiple perceptrons leads to multi-layer networks, which can approximate almost any function.


🦴 @scopeofai | #concepts
🧩 بریم با هم آخرین مقاله OpenAI رو تحلیل کنیم، مقاله جالبی که به مسئله hallucination توی مدل های زبانی بزرگ می‌پردازه و شرح می‌ده که چرا اصلا این اتفاق می‌افته...

Let's analyze OpenAI's latest paper together, an interesting article that addresses the issue of hallucination in large language models and explains why this happens at all...
چکیده

🤖 وقتی صحبت از مدل های بزرگ زبانی می‌شه، یه مشکل بزرگ وجود داره: اونا توهم می‌زنن. یعنی چیزهایی رو با اعتمادبه‌نفس کامل می‌سازن که اصلاً درست نیست.

این مقاله دنبال یک جواب اساسی می‌گرده: چرا این اتفاق حتی در بزرگ‌ترین و پیشرفته‌ترین مدل‌ها می‌افته؟

توهم یه اشکال تصادفی نیست، بلکه عمیقاً به خودِ روش آموزش مدل‌ها گره خورده.

Abstract — The Big Mystery

🔬 Large language models are impressive — they write essays, code, even poetry.
But there’s a catch: they hallucinate. They make things up with full confidence.

This paper asks a hard question: why does this happen, even in the biggest and most advanced models?

The promise: by the end, we’ll see hallucination not as a random glitch, but as something deeply tied to how these models are trained.


🔰 @scopeofai | #papers
مقدمه

🔹 توهم نادر نیست

🔹یه نویز اتفاقی نیست

ریشه‌ش توی فرمول آموزشی مدله: مدل‌ها یاد گرفتن کلمه بعدی رو پیش‌بینی کنن، نه اینکه حقیقت رو بگن.

پس معما اینه که چطور سیستمی که این‌قدر خوب و دقیقه، توی واقعیت این‌قدر خطا می‌کنه؟

Introduction

🔹Hallucination isn’t rare.

🔹It’s not just noise.

It comes from the training recipe itself: models are taught to predict the next word, not to tell the truth.

So the puzzle: how can a system so good at language fail at facts?


🔰 @scopeofai | #papers
کارهای مرتبط

قبل از این مقاله، پژوهش‌ها چند توضیح داده بودن:

▫️شاید مدل اصلاً اون دانش رو نداره.

▫️شاید خیلی «اعتمادبه‌نفس کاذب» داره.

▫️داده‌های آموزشی مدل کافی نبوده.

مقاله می‌گه که اینا فقط بخشی از ماجراست. دلیل عمیق‌تر ساختاریه. توهم فقط یه شکاف دانشی نیست؛ توی DNA روش آموزش مدل‌هاست.

Related Work — Previous Clues

Before this paper, researchers gave several explanations:

▫️Maybe the model just doesn’t have the right knowledge.

▫️Maybe it’s too “overconfident” in its outputs.

▫️Maybe the training data was too limited.

This paper says: those are partial answers. The deeper reason is structural. Hallucinations aren’t only gaps — they’re baked into the way we train LLMs.


🔰 @scopeofai | #papers
روش تحقیق

برای اینکه فقط حدس و گمان نباشه، نویسنده‌ها آزمایش‌هایی طراحی کردن:

♦️به مدل سؤال‌های واقعی و قابل‌بررسی دادن.

⬅️خروجی‌ها رو ثبت کردن.

🔁هر جواب رو با حقیقت مقایسه کردن.

روی احتمال انتخاب کلمات هنگام تولید متن تمرکز کردن تا بفهمن چرا مدل مسیر اشتباه رو انتخاب کرده.

انگار مغز مدل رو باز کردن و قدم‌به‌قدم دیدن چطور فکر می‌کنه.

Methodology — Into the Lab

To go beyond speculation, the authors set up controlled experiments.

They feed models factual questions with known answers.

They log what the model generates.

They compare each response to the truth.

They dive into the token probabilities to see why the wrong choice was made.

Think of it like opening up the model’s brain and watching its thought process in slow motion.


🔰 @scopeofai | #papers
نتایج

اینجاست که غافلگیر می‌شیم:

🔶 مدل‌ها توهم می‌زنن حتی وقتی قبلاً جواب درست رو دیده‌ان.

چرا؟ چون در عمل، روان بودن متن مهم‌تر از درست بودنشه.

احتمال انتخاب یک کلمه روانِ اشتباه، بیشتر از یه کلمه درستِ دست‌وپا شکسته است.

بزرگ‌تر کردن مدل هم مشکل رو حل نمی‌کنه؛ بعضی وقتا حتی توهم رو بیشتر می‌کنه.

نتیجه ناراحت‌کننده اینه که توهم نشانه نادانی مدل نیست، عوارض جانبی همون هدف آموزشیه.

Results — The Strange Discovery

Here’s the twist:

🔸Models hallucinate even when they’ve seen the correct fact before.

Why? Because when generating text, fluency beats factuality.

The model often prefers a smooth-sounding wrong answer over a clunky correct one.

Scaling up (making the model bigger) doesn’t solve it. In some cases, bigger models hallucinate more.

That’s the uncomfortable truth: hallucinations are not ignorance, they’re a side-effect of the objective.



🔰 @scopeofai | #papers
بحث

👁‍🗨 واقعاً چه خبره؟

راستش تنها هدف مدل، پیش‌بینی کلمه بعدیه.

«حقیقت» اصلاً توی معادله نیست.

اگه یه کلمه غلط بیشتر با جمله جور باشه، احتمال انتخابش بالاتر می‌ره.

اینجوری توهم تبدیل به یه معامله اجتناب‌ناپذیر می‌شه:

هرچی متن روان تر باشه و به متن انسان شباهت بیشتری داشته باشه، ریسک توهم بالاتر می‌ره.
پس باید روش آموزش عوض بشه.

Discussion — The Heart of the Matter

🪝 So what’s really going on?

The model’s only goal is to predict the next word.

“Truth” isn’t part of the equation.

If a wrong word fits better into a sentence, probability pushes the model there.

This reframes hallucination as a trade-off:

If you want smooth, human-like text, hallucination risk increases.

If you want pure factuality, you’d need a different training paradigm.


🔰 @scopeofai | #papers
2
نتیجه‌گیری

پیام پایانی مقاله صریح بود: توهم‌ها خودبه‌خود محو نمی‌شن.

راه‌حل‌های احتمالی:

✳️ تولید همراه با بازیابی (RAG): مدل حین نوشتن بره و منبع بیرونی چک کنه.

کالیبراسیون واقعیت: خروجی‌ها رو طوری تنظیم کنیم که حقیقت بیشتر وزن داشته باشه.

❇️ آموزش ترکیبی: فقط به روان بودن متن پاداش ندیم، بلکه برامون مهم باشه که با واقعیت هم معیار باشه.

تا اون موقع، استفاده از خروجی خام LLMها بدون کنترل یعنی پذیرش توهم‌ها.

Conclusion — What Next?

The paper closes with a sober message: hallucinations won’t magically vanish.

Possible fixes:

❇️Retrieval-Augmented Generation (RAG): let the model check a database while writing.

✳️Factual calibration: tune outputs to favor truth over style.

Hybrid training: reward not just language fluency, but factual grounding.

Until then, using LLMs without external checks means living with hallucinations.


🔰 @scopeofai | #papers
🔥1
برداشت پایانی

🔅 توهم‌ها باگ نیستن. اون‌ها روی تاریک پیش‌بینی کلمه بعدی هستن.
تا وقتی مدل‌ها برای روان بودن بهینه بشن نه برای حقیقت، توهم خواهند زد.

این مقاله زاویه نگاه رو عوض می‌کنه. درمان توهم با «داده بیشتر» یا «مدل بزرگ‌تر» نیست؛ باید خود هدف آموزش رو دوباره طراحی کنیم.

Final Takeaway

🔅Hallucinations are not a bug. They’re the shadow side of next-word prediction.
As long as models are optimized for fluency, not truth, they will invent.

The paper changes how we see the problem: fixing hallucination isn’t about “more data” or “bigger models” — it’s about rethinking the very goal of training.


🔰 @scopeofai | #papers
🔥1
پنجره زمینه (Context Window) چیه؟

🪟 پنجره‌ی زمینه (یا طول زمینه) یعنی مقدار متنی که مدل زبانی بزرگ (LLM) می‌تونه همزمان «ببینه» یا «به خاطر بسپاره»، که با واحدی به اسم «توکن» اندازه‌گیری می‌شه.

مثل حافظه‌ی کاری بشره. مدل وقتی داره متن تولید می‌کنه، بخش‌هایی از مکالمه یا سند قبلی رو به یاد داره تا خروجی مناسبی بده.

اگر مقداری که وارد می‌کنی از این حد فراتر بره، بخشی از متن باید بریده بشه یا خلاصه شه تا مدل بتونه ادامه بده.

The context window (also called “context length”) is how much text (in tokens) a large language model (LLM) can “see” or “remember” at once.

It’s like working memory: it lets the model use prior parts of a conversation or document when generating output.
IBM

If you give a prompt + conversation that exceed the context window, the extra parts have to be truncated (cut off) or summarized.


🦴 @scopeofai | #concepts
♨️ پنجره زمینه بزرگ‌تر به مدل‌ها اجازه می‌ده ورودی‌های بلندتری رو پردازش کنن: اسناد طولانی، کدهای زیاد، سابقه مکالمه‌ها بدون اینکه جزئیات اوایلشون رو فراموش کنن.

مدل‌هایی که مقدار context بزرگ‌تری دارن معمولا پاسخ‌های منسجم‌تری می‌دن، خطاهای توهمی‌شون کمتره، مخصوصاً وقتی درخواست یا پرامپت طولانی باشه.

اما بزرگ‌تر کردن پنجره زمینه هزینه‌ها هم داره: محاسبات بیشتر، مصرف حافظه بالاتر، هزینه مالی و زمان پاسخ‌دهی بیشتر. همچنین ریسک‌های امنیتی، مثل این که ورودی‌های مخرب بتونن توی متون بلند پنهان بمونن، افزایش پیدا می‌کنن.

Bigger context windows let LLMs handle longer inputs: long documents, code, chat histories without forgetting early details.

Models with larger context length tend to be more coherent, make fewer hallucinations, and give more accurate responses when prompts are long.

But increasing context window has trade-offs: more computation, higher memory, more cost, potentially slower responses. Also, security risks like adversarial prompt injections grow.


🦴 @scopeofai | #concepts
🔅 دونستن اندازه پنجره زمینه کمک می‌کنه پرامپت‌ها رو بهتر طراحی کنی: اطلاعات مهم رو در ابتدا یا انتها بذار تا از بین نرن.

بعضی مدل‌ها مثل Granite شرکت IBM الان پنجره‌هایی تا حدود ۱۲۸۰۰۰ توکن دارن، که امکان پردازش اسناد یا مکالمات خیلی طولانی رو در یک مرحله فراهم می‌کنن.

محدودیت‌ها هم وجود دارن. حتی اگر پنجره خیلی بزرگ باشه، مدل ممکنه قسمت‌های میانی ورودی رو نادیده بگیره یا کیفیت پاسخ‌ها پایین بیاد. همچنین هزینه‌ها (محاسبه، حافظه) تقریباً با مجذور تعداد توکن‌ها زیاد می‌شن.

For practical systems: if you're building chatbots or tools that use LLMs, knowing the context window size helps you design prompts better: keep key info near beginning or end so it isn’t lost.

Some models (e.g. IBM’s Granite) now have windows up to 128,000 tokens, enabling much longer documents / conversations to be handled in one go.

Limitations: even if the window is large, models might still “ignore” middle parts of the input, or performance may degrade. Also, the cost (compute, memory) scales roughly quadratically with token count.


🦴 @scopeofai | #concepts
🪤 متا پرامپت چیه؟

متا پرامپت یه سری دستور کلیه که مشخص می‌کنه هوش مصنوعی چطوری رفتار کنه یا جواب بده.

فرقش با یه پرامپت عادی اینه که فقط برای یه سؤال یا یه جواب نیست؛ بلکه مثل یه «قالب» یا «چهارچوب» عمل می‌کنه که همه جواب‌ها توی همون خط بیاد.

مثلا می‌تونی هوش مصنوعی رو طوری تنظیم کنی که همیشه مثل یه دستیار آموزشی جواب بده، لحنش رسمی باشه، یا طبق یه برنامه‌ی درسی مشخص محتوا تولید کنه.
What is a Meta Prompt?

A meta prompt is a set of higher-level instructions that shapes how an AI behaves or responds in general, not just for a single task. Think of it as the framework or lens through which all following prompts are interpreted.

It defines the AI’s role/persona, sets rules or constraints, establishes style, tone, sometimes even procedural steps. This ensures consistency across multiple interactions.

Example: Suppose you want AI to always answer as a teaching assistant, align with a certain curriculum, use certain formatting, etc.


🦴 @scopeofai | #concepts
اجزای اصلی متا پرامپت

🔷تعریف نقش مشخص می‌کنه AI کیه. مثلا: «تو یه دستیار آموزشی هستی که کارش درست کردن ورک‌شیت برای کلاس فلان بر اساس فلان سرفصل درسیه…»

🔷هدف می‌گه قرار آخرش به چی برسیم. مثل: «کمک به معلم برای تولید ورک‌شیت جذاب و منظم که با اهداف درسی هم‌خوان باشه.»

🔷دستورالعمل مرحله‌ای قدم‌به‌قدم توضیح می‌ده چیکار کنه. مثلا: اول موضوع درس رو بپرس، بعد اهداف رو مشخص کن، بعد بخش‌های ورک‌شیت رو بساز.

🔷نکات ویژه لحن، سبک نوشتن، سطح دشواری، رعایت محدودیت‌های سنی و فرهنگی، یا حتی نوع فرمت.

🔷انعطاف‌پذیری متا پرامپت خوب باید جا برای تغییر داشته باشه. مثلا اگه کاربر گفت فلان بخش رو تغییر بده، AI بتونه خودش رو وفق بده.


Key Elements of Meta Prompts

Here are the main ingredients that good meta prompts often include:

Element Function / Why It Matters
Role Definition Sets who the AI is in this context. For example: “You are a helpful and experienced teaching assistant specialising in creating worksheets aligned with [curriculum] …” This gives the AI a clear identity.

Goal Setting Tells the AI what outcome you want. What is the end-objective? If the goal is “guide teachers through generating well-structured, engaging worksheets that complement lesson plans …”, then everything the AI does is steered toward that.

Procedural Instructions The “how” part: step-by-step directions on how the AI should proceed. Eg: ask the teacher about subject, grade, topic; wait; then produce elements. These help avoid messy or inconsistent outputs.

Specific Considerations Style or tone: how the AI should sound (friendly, supportive, formal); content constraints (age-appropriateness, cultural relevance); formatting rules. These maintain quality and relevance.

Flexibility / Adaptability Even though meta prompts are strong, good ones allow room for feedback, changing requirements, responsiveness. AI should be able to adjust when conditions change (e.g. teacher asks for adjustments)


🦴 @scopeofai | #concepts
چرا متا پرامپت مهمه؟

◽️یکدست بودن: جواب‌ها همه یه سبک دارن

◽️صرفه‌جویی در وقت: لازم نیست هر دفعه همه‌چیزو از اول توضیح بدی.

◽️تخصصی شدن: AI رو می‌تونی تبدیل به یه متخصص توی یه حوزه خاص کنی.

◽️تمرکز روی نیاز کاربر: چون هدف و قواعد روشنه، خروجی به چیزی که کاربر می‌خواد نزدیک‌تره.

Benefits of Meta Prompt

Consistency across multiple tasks or queries. AI doesn’t flip style or approach unexpectedly.


Efficiency: fewer clarifications needed each time. You set context once

Specialisation: AI can be made expert-like in a domain (education, legal, creative writing etc.)

User-Centric: better alignment with what the user or stakeholder needs, because the meta prompt encodes priorities


🦴 @scopeofai | #concepts
💡نمونه یه متا پرامپت

تو یه دستیار آموزشی با تجربه‌ای هستی که کارش تولید ورک‌شیت برای معلم‌هاست، هدفت اینه که به معلم کمک کنی ورک‌شیت‌هایی منظم، جذاب و هم‌راستا با اهداف آموزشی درست کنن.

ابتدا به معلم سلام کن و بپرس برای چه درسی، چه پایه‌ای و چه موضوعی ورک‌شیت می‌خواد. هر بار یه سؤال بپرس و منتظر جواب بمون. وقتی اطلاعات رو گرفتی:

1. سرفصل مربوط رو بررسی کن تا مطمئن شی ورک‌شیت با اون هماهنگه.
2. از معلم بپرس دقیقا دنبال چه خروجی‌های یادگیری‌ایه.
3. قدم‌به‌قدم راهنمایی کن تا بخش‌های ورک‌شیت شکل بگیره: عنوان، دستورالعمل‌ها، واژگان، انواع سؤال، تمرین‌های کاربردی، شکل یا نمودار، سؤال‌های تحلیلی و… .
4. برای هر بخش مثال و پیشنهاد بده.
5. بعد از هر بخش نظر معلم رو بپرس.
6. در آخر نسخه کامل ورک‌شیت رو با کلید پاسخ آماده کن.
7. اگه لازمه، برای ارزیابی هم یه جدول نمره‌دهی (روبریک) پیشنهاد بده.
8. بپرس آیا ورک‌شیت باید برای سطح‌های مختلف دانش‌آموز هم تنظیم بشه.
9. اگه نیاز بود، المان‌های دیجیتال یا منابع آنلاین مرتبط هم پیشنهاد بده.

همیشه یادت باشه:
- لحن دوستانه و حمایتی داشته باشی
- نیاز معلم رو در اولویت بذاری ولی منطبق باشی
- محتوای سن‌متناسب، مرتبط با فرهنگ آفریقای جنوبی و هم‌خوان با سرفصل باشه
- ورک‌شیت رو جذاب و متنوع کن
- نکات کاربردی برای استفاده در کلاس یا تکلیف بده
- تفاوت‌های زبانی کلاس‌ها رو در نظر بگیر و راهکار برایش بده


🦴 @scopeofai | #concepts