Мова AI GUIDE

Навчання в контексті

In-context learning uses information or demonstrations in a prompt to adapt a language model's response without updating its weights.

Послухайте цей посібникШІ-розказаний · ~3 min

На цій сторінці3 хвилини читання
  1. Огляд
  2. Глибоке занурення
  3. Реалізація в реальному світі
  4. Майбутнє навчання в контексті
  5. Застосування на практиці
  6. Продовжуйте досліджувати
  7. Часті запитання

Огляд

It provides a flexible way to show a task or format, while results depend on the model and prompt rather than a guaranteed learning threshold.

Глибоке занурення

Ordinary fine-tuning updates a model's parameters through training. In-context learning instead puts information and demonstrations into the input supplied at inference. The model's weights remain fixed while its internal activations and predictions depend on that input. A zero-shot prompt gives no task demonstrations, a one-shot prompt gives one, and a few-shot prompt gives several. For example, demonstrations can show support messages paired with the labels refund and billing; a new message can then be presented using the same structure. The examples suggest the desired pattern without guaranteeing a correct classification. The GPT-3 paper evaluated task demonstrations supplied through text without gradient updates and reported improvements with scale across many tasks. That evidence does not establish a universal one-hundred-billion-parameter threshold below which in-context learning is impossible. Prompt design also matters. Lu and colleagues demonstrated sensitivity to the order of few-shot examples in their evaluated classification settings, so reordering identical examples can change results without changing model weights. Demonstrations can illustrate a format or task relationship, but they are still input tokens that must be processed. Adding more examples uses more of the supported context budget and can increase per-request work; it is not automatically a quality improvement. For a stable application, compare prompting and fine-tuning using task quality, training effort, request costs, and maintenance needs instead of assuming one method is always cheaper.

Реалізація в реальному світі

Надати чат-боту три приклади заявок у службу підтримки та їх категорії, а потім класифікувати нову заявку таким же чином

Показ моделі з двома парами безладного тексту до/після, переформатованого в чистий JSON, щоб він перетворив решту

Вставте пару прикладів опису продукту в тоні вашого бренду, щоб нові відповідали стилю

Демонстрація складної математичної текстової задачі працювала крок за кроком, тому модель розв’язувала подібні проблеми в тому самому форматі міркування

Майбутнє навчання в контексті

Larger supported contexts make it possible to supply more examples, but they also create choices about relevance and request cost. Retrieval can help select examples appropriate to the current task. Evaluate the same representative requests under different prompt designs and compare those results with a fine-tuned alternative when relevant. A useful report states the model, examples, ordering, and evaluation task. Greater prompt length is a resource choice rather than a guarantee of learning, and few-shot behavior still needs checks on held-out inputs.

Застосування на практиці

Чому це важливо

  • Швидкість і масштаб. Мовні робочі процеси можуть рухатися швидше без шкоди для узгодженості.
  • Доступ і охоплення. Це розширює доступ до різних мов і стилів спілкування.
  • Чіткіші рішення. Команди можуть витрачати більше часу на оцінювання, поки автоматизація справляється з повторенням.

Зверніть увагу на

  • Галюциновані факти можуть непомітно входити у звіти, допоміжні потоки або результати досліджень.
  • Делікатність підказок може створити суперечливі результати для подібних запитів.
  • Конфіденційні текстові дані можуть бути розкриті, якщо контроль доступу слабкий.

Наступні кроки

  1. Визначте вихідний формат, тон і стандарти якості перед розгортанням.
  2. Якщо точність має значення, зв’яжіться з надійними джерелами.
  3. Тримайте контрольну точку перевірки людьми для отримання високих ставок.
  4. Відстежуйте моделі збоїв і регулярно перенавчайте підказки або робочі процеси.

Продовжуйте досліджувати

Безплатний розсилок

Отримуйте щоденне зведення новин про ШІ

Три перевірені історії про ШІ щоробочого ранку, написані простою мовою. Безплатно назавжди, без реклами.

Один лист щотижня з понеділка по п'ятницю. Відписатися в один клік. Ми ніколи не продаємо та не передаємо вашу адресу.

Перевір себе

Take the In-Context Learning quiz

Миттєва зворотна связь на кожну відповідь та сертифікат із перевіреним ідентифікатором, яким можна поділитися, після проходження курсу.

Розпочати вікторину

Підтримайте безплатну освіту у сфері ШІ. AI Understanding — це некомерційна організація 501(c)(3) — без реклами, без платних стін, назавжди. Зробіть пожертву

Часті запитання

What is In-Context Learning?

In-context learning uses information or demonstrations in a prompt to adapt a language model's response without updating its weights. It provides a flexible way to show a task or format, while results depend on the model and prompt rather than a guaranteed learning threshold.

Що принципово змінюється всередині моделі під час навчання в контексті?

Навчання в контексті відбувається виключно на основі висновків. Приклади в підказці формують активації моделі та передбачення наступного маркера, але ваги не оновлюються.

What does GPT-3's reported improvement in few-shot performance with scale establish?

The study reports task and model results, not a universal parameter threshold for in-context behavior.

How should induction-head research be related to broad in-context learning?

The cited work distinguishes stronger findings in small attention-only models from preliminary or indirect broader evidence.

How should an application compare repeated few-shot prompting with fine-tuning?

Stable high-volume use can motivate comparison, but costs and quality depend on the actual setup.

A few-shot ticket prompt demonstrates only refund and billing labels. What do those examples provide for the next ticket?

Demonstrations show a desired input-output pattern, while correctness still needs evaluation.

Продовжуйте вчитися

Пов'язані посібники

Інші посібники, вибрані для цієї теми

Отримайте безкоштовний сертифікат зі ШІКороткий безкоштовний курс та іспит. Безкоштовно, без картки. Близько 2,5 години.Почати безкоштовно →