Skip to content

Commit

Permalink
XS✔ ◾ new-rule-evaluate-slms-vs-azure-cloud-llms (#9343)
Browse files Browse the repository at this point in the history
* new-rule-evaluate-slms-vs-azure-cloud-llms

* Auto-fix Markdown files

* update-author

* Update rules/evaluate-slms-vs-azure-cloud-llms/rule.md

Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>

* Update rules/evaluate-slms-vs-azure-cloud-llms/rule.md

Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>

* Update rules/evaluate-slms-vs-azure-cloud-llms/rule.md

Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>

* Update rules/evaluate-slms-vs-azure-cloud-llms/rule.md

Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>

* Update rules/evaluate-slms-vs-azure-cloud-llms/rule.md

Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>

* Update rules/evaluate-slms-vs-azure-cloud-llms/rule.md

Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>

* Update rules/evaluate-slms-vs-azure-cloud-llms/rule.md

Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>

* Update rules/evaluate-slms-vs-azure-cloud-llms/rule.md

Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>

* Update rules/evaluate-slms-vs-azure-cloud-llms/rule.md

Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>

* Update rules/evaluate-slms-vs-azure-cloud-llms/rule.md

Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>

* Update rules/evaluate-slms-vs-azure-cloud-llms/rule.md

Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>

* Update rules/evaluate-slms-vs-azure-cloud-llms/rule.md

Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jernej Kavka (JK) [SSW • Microsoft MVP] <[email protected]>
  • Loading branch information
3 people authored Oct 4, 2024
1 parent abb6815 commit 95f52ef
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ index:
- train-gpt
- use-system-prompt
- use-semantic-kernel
- evaluate-slms-vs-azure-cloud-llms
- write-integration-tests-for-llm-prompts
- website-chatbot
- leverage-chatgpt
Expand Down
53 changes: 53 additions & 0 deletions rules/evaluate-slms-vs-azure-cloud-llms/rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
seoDescription: Learn how to evaluate the performance of Small Language Models (SLMs) compared to Azure AI’s cloud-based LLMs to find the most cost-effective and efficient solution.
type: rule
title: Do you evaluate SLMs for performance compared to Azure AI’s cloud-based LLMs?
uri: evaluate-slms-vs-azure-cloud-llms
authors:
- title: Jernej Kavka
url: https://www.ssw.com.au/people/jernej-kavka/
created: 2024-10-03T16:15:00.000Z
guid: e9b7c5bc-cb35-4876-9785-d2031fb4f69e
---

When using [Azure AI services](https://learn.microsoft.com/en-us/azure/ai-services/what-are-ai-services), you often choose between Small Language Models (SLMs) and powerful cloud-based Large Language Models (LLMs), like [Azure OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/). While Azure OpenAI offer significant capabilities, they can also be expensive. In many cases, SLMs like [Phi-3](https://azure.microsoft.com/en-us/blog/introducing-phi-3-redefining-whats-possible-with-slms/?msockid=08740f8c07f1631f3aeb1dfc061c62cc), can perform just as well for certain tasks, making them a more cost-effective solution. Evaluating the performance of SLMs against Azure OpenAI services is essential for balancing cost and performance.

<!--endintro-->
::: greybox
A startup builds a simple FAQ chatbot that answers repetitive customer service questions like “What are your business hours?” or “How do I reset my password?” They choose to implement Azure OpenAI services, leading to high operational costs. An SLM could have provided the same answers without the extra expense.
:::
::: bad
Figure: Bad example - Using Azure OpenAI services for simple FAQ tasks incurs high costs, while an SLM would be more cost-effective
:::

::: greybox
A financial services company needs to develop a chatbot to guide customers through complex mortgage applications, requiring the chatbot to understand intricate details and provide personalized advice. After evaluating both, they use Azure OpenAI GPT-4o due to its better handling of complex queries and personalized responses, which an SLM could not manage effectively.
:::
::: good
Figure: Good example - Choosing Azure OpenAI GPT-4o for complex tasks after evaluation provides better customer service and justifies the higher cost
:::

### Why evaluate SLMs?

**Cost considerations**: Azure OpenAI services, such as GPT-4o, charge per usage, which can quickly add up. On the other hand, SLMs, which can be deployed locally or in a more cost-efficient environment, may offer similar results for less complex tasks, reducing overall costs

**Performance needs**: Not every task requires the full power of a cloud-based LLM. Tasks like text classification, keyword extraction, or template-based responses can often be handled just as well by an SLM, saving both on compute resources and cost

**Model control**: Using an SLM, particularly if it is deployed locally, offers more control over the model’s behavior, updates, and fine-tuning. This can be valuable for applications where privacy, security, or specific customizations are required

### How to evaluate SLMs against Azure OpenAI services

**Set performance benchmarks**: Run both the SLM and Azure OpenAI services on the same dataset or task. Measure their performance in terms of accuracy, response quality, latency, and resource consumption

**Compare output quality**: Test how well each model responds to different types of queries, from simple to complex. While Azure’s LLMs might excel at complex, open-ended tasks, an SLM may be sufficient for simpler, well-defined tasks

**Consider deployment environment**: Evaluate whether the SLM can be easily integrated into your existing Azure infrastructure. Consider factors like memory and CPU requirements, latency, and whether an SLM can match the scalability offered by Azure’s cloud services

**Estimate long-term costs**: Calculate the ongoing costs of using Azure’s LLMs, factoring in API fees and compute resources. Then, compare these costs with the deployment and maintenance costs of an SLM, especially for high-volume applications. Long-term savings can be substantial when using SLMs for tasks where full LLM power is unnecessary

### When to stick with Azure AI’s cloud LLMs

* For complex tasks that require deep understanding, creativity, or nuanced language generation, Azure OpenAI service, like GPT-4o, may still be the best choice
* Cloud-based LLMs offer ease of scalability and quick integration with Azure services, making them ideal for projects that need high availability or require rapid deployment without complex infrastructure management

By evaluating SLMs against Azure OpenAI services, you can make informed decisions that balance performance with cost, ensuring your AI deployments are both efficient and economical.

0 comments on commit 95f52ef

Please sign in to comment.