Skip to content

Commit a3c7993

Browse files
authored
Merge pull request #278358 from schaffererin/userstory264141
New conceptual doc on language models for AI and machine learning
2 parents f7a1896 + ca97afb commit a3c7993

File tree

2 files changed

+98
-0
lines changed

2 files changed

+98
-0
lines changed

articles/aks/TOC.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@
150150
href: concepts-network-services.md
151151
- name: Ingress
152152
href: concepts-network-ingress.md
153+
- name: AI and machine learning
154+
items:
155+
- name: Small and large language models
156+
href: concepts-ai-ml-language-models.md
153157
- name: Advanced Container Networking Services
154158
items:
155159
- name: Advanced Container Networking Services overview
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
title: Concepts - Small and large language models
3+
description: Learn about small and large language models, including when to use them and how you can onboard them to your AI and machine learning workflows on Azure Kubernetes Service (AKS).
4+
ms.topic: conceptual
5+
ms.date: 06/24/2024
6+
author: schaffererin
7+
ms.author: schaffererin
8+
---
9+
10+
# Concepts - Small and large language models
11+
12+
In this article, you learn about small and large language models, including when to use them and how you can use them with your AI and machine learning workflows on Azure Kubernetes Service (AKS).
13+
14+
## What are language models?
15+
16+
Language models are powerful machine learning models used for natural language processing (NLP) tasks, such as text generation and sentiment analysis. These models represent natural language based on the probability of words or sequences of words occurring in a given context.
17+
18+
*Conventional language models* have been used in supervised settings for research purposes where the models are trained on well-labeled text datasets for specific tasks. *Pre-trained language models* offer an accessible way to get started with AI and have become more widely used in recent years. These models are trained on large-scale text corpora from the internet using deep neural networks and can be fine-tuned on smaller datasets for specific tasks.
19+
20+
The size of a language model is determined by its number of parameters, or *weights*, that determine how the model processes input data and generates output. Parameters are learned during the training process by adjusting the weights within layers of the model to minimize the difference between the model's predictions and the actual data. The more parameters a model has, the more complex and expressive it is, but also the more computationally expensive it is to train and use.
21+
22+
In general, **small language models** have *fewer than 10 billion parameters*, and **large language models** have *more than 10 billion parameters*. For example, the new Microsoft Phi-3 model family has three versions with different sizes: mini (3.8 billion parameters), small (7 billion parameters), and medium (14 billion parameters).
23+
24+
## When to use small language models
25+
26+
### Advantages
27+
28+
Small language models are a good choice if you want models that are:
29+
30+
* **Faster and more cost-effective to train and run**: They require less data and compute power.
31+
* **Easy to deploy and maintain**: They have smaller storage and memory footprints.
32+
* **Less prone to *overfitting***, which is when a model learns the noise or specific patterns of the training data and fails to generalize new data.
33+
* **Interpretable and explainable**: They have fewer parameters and components to understand and analyze.
34+
35+
### Use cases
36+
37+
Small language models are suitable for use cases that require:
38+
39+
* **Limited data or resources**, and you need a quick and simple solution.
40+
* **Well-defined or narrow tasks**, and you don't need much creativity in the output.
41+
* **High-precision and low-recall tasks**, and you value accuracy and quality over coverage and quantity.
42+
* **Sensitive or regulated tasks**, and you need to ensure the transparency and accountability of the model.
43+
44+
The following table lists some popular, high-performance small language models:
45+
46+
| Model family | Model sizes (Number of parameters) | Software license |
47+
|--------------|------------------------------------|------------------|
48+
| Microsoft Phi-3 | Phi-3-mini (3.8 billion), Phi-3-small (7 billion) | MIT license |
49+
| Microsoft Phi-2 | Phi-2 (2.7 billion) | MIT license |
50+
| Falcon | Falcon-7B (7 billion) | Apache 2.0 license |
51+
52+
## When to use large language models
53+
54+
### Advantages
55+
56+
Large language models are a good choice if you want models that are:
57+
58+
* **Powerful and expressive**: They can capture more complex patterns and relationships in the data.
59+
* **General and adaptable**: They can handle a wider range of tasks and transfer knowledge across domains.
60+
* **Robust and consistent**: They can handle noisy or incomplete inputs and avoid common errors and biases.
61+
62+
### Use cases
63+
64+
Large language models are suitable for use cases that require:
65+
66+
* **Abundant data and resources**, and you have the budget to build and maintain a complex solution.
67+
* **Low-precision and high-recall tasks**, and you value coverage and quantity over accuracy and quality.
68+
* **Challenging or exploratory tasks**, and you want to leverage the model's capacity to learn and adapt.
69+
70+
The following table lists some popular, high-performance large language models:
71+
72+
| Model family | Model sizes (Number of parameters) | Software license |
73+
|--------------|------------------------------------|------------------|
74+
| Microsoft Phi-3 | Phi-3-medium (14 billion) | MIT license |
75+
| Falcon | Falcon-40B (40 billion) | Apache 2.0 license |
76+
77+
## Experiment with small and large language models on AKS
78+
79+
Kubernetes AI Toolchain Operator (KAITO) is an open-source operator that automates small and large language model deployments in Kubernetes clusters. The KAITO add-on for AKS simplifies onboarding and reduces the time-to-inference for open-source models on your AKS clusters. The add-on automatically provisions right-sized GPU nodes and sets up the associated interference server as an endpoint server to your chosen model.
80+
81+
For more information, see [Deploy an AI model on AKS with the AI toolchain operator][ai-toolchain-operator]. To get started with a range of supported small and large language models for your inference workflows, see the [KAITO model GitHub repository][kaito-repo].
82+
83+
## Next steps
84+
85+
To learn more about containerized AI and machine learning workloads on AKS, see the following articles:
86+
87+
* [Use KAITO to forecast energy usage with intelligent apps][forecast-energy-usage]
88+
* [Build and deploy data and machine learning pipelines with Flyte on AKS][flyte-aks]
89+
90+
<!-- LINKS -->
91+
[ai-toolchain-operator]: ./ai-toolchain-operator.md
92+
[forecast-energy-usage]: https://azure.github.io/Cloud-Native/60DaysOfIA/forecasting-energy-usage-with-intelligent-apps-1/
93+
[flyte-aks]: ./use-flyte.md
94+
[kaito-repo]: https://github.com/Azure/kaito/tree/main/presets

0 commit comments

Comments
 (0)