Thursday, May 15, 2025

7 Business Advantages of a Custom Copilot

Microsoft Copilot is an AI generative assistant, designed to understand users requests in every day common spoken language.

This assistant can be custom tailored for a specific business to quickly provide answers to customers. 

This eliminates the need for customers to browse a web site or use a search engine to get answers for specific products (i.e. pricing, sizes, etc.) 

Instead, customers can now ask questions like "What colors are available?" and receive direct answers.

 

This provides every business with an edge over the competition.

Here's why investing in a custom Copilot could be one of the smartest moves for your business.

 

1. Enhanced Efficiency & Productivity

A custom Copilot is designed to integrate seamlessly into your website or app.

 

2. Business Specific Expertise

A custom Copilot can be trained with your business-specific knowledge, making it an expert in your particular business domain.

This would allow customers to ask it specific questions and get specific answers, in plain everyday English

 

3. Reach More Customers

A custom copilot can offer Speech Capabilities where questions can be asked verbally and answers provided via audio. 

This would help reach visually or physically impaired customers.

 

4. Reach More International Customers

By using Language Translation, your custom Copilot can communicate with international customers in the language of their choice,

providing more reach for the foreign customer base. More Customers = More Sales.

 

5. Competitive Edge

By quickly providing answers to your customers' questions, a business can quickly gain an advantage over its competition. 

No longer do customers need to use a search engine or browse a web site for answers on pricing & availability. 

Instead, a quick question and answer with copilot will get the job done quickly leading to a better customer experience and potentially increased sales.

 

6. Increased Data Security & Compliance

Custom Copilots can be designed with specific security protocols and compliance measures that align with your business needs.

By controlling how data is processed, stored, and shared, companies can minimize risks associated with third-party AI services while ensuring compliance with regulatory requirements.

In addition, Microsoft's data policy on AI is "your data remains your data only".

 

7. Cost Savings & ROI

While a custom Copilot requires a single upfront investment in development, the long-term benefits far outweigh the costs.

It will quickly provide answers to customers without negatively impacting CSRs.

Businesses can reduce labor costs, improve service efficiency, and capitalize on AI-driven insights to boost profitability over time.

 

 

In a Nutshell…

A custom Copilot isn't just an AI tool—it's a strategic advantage. By tailoring AI to your business needs, you can drive efficiency, enhance customer experiences,

maintain security, and gain a competitive edge in your industry. In a world where technology is reshaping the way we work, a personalized AI solution could be the

key to unlocking the next level of success for your business.

Ready to explore the possibilities? Let's build a future where AI works for you, not just with you.

Wednesday, May 7, 2025

What's Stable Diffusion?

Stable Diffusion is a text-to-image model, a type of generative AI that creates images based on text prompts. It uses diffusion techniques and operates in a latent space to generate detailed and photorealistic images.

It’s similar to Dall-E and Midjourney but offers different advantages:

 

Strengths: Offers the most customization options, allowing users to fine-tune image generation with various parameters.

Use Cases: Ideal for tasks requiring precise control over the image generation process, such as image editing and manipulation.

Accessibility: Available as both a free and paid service, with different tiers of access.

Interface: Can be accessed through various platforms, such as DreamStudio and Azure AI Foundry.

 

To get started, you’ll need to know some of the terminology and how they relate in the context of Stable Diffusion:

  • Workflow: The structured process of generating images using Stable Diffusion, including steps like prompt input, model selection, and refinement.
  • LoRA (Low-Rank Adaptation): A technique for fine-tuning Stable Diffusion models efficiently without retraining the entire model.
  • Checkpoint: A saved state of a trained model, often in .ckpt or .safetensors format, used for loading and continuing training or inference.
  • Vector: A mathematical representation of data, often used in embeddings or latent space transformations within AI models.
  • Sampler: The algorithm that determines how noise is removed during image generation, affecting the final output’s quality and style.
  • Tensor: A multi-dimensional array used in deep learning to store and process data efficiently.
  • Safe Tensor: A format for storing model weights that improves security and prevents malicious modifications.

 

In addition, here are resources to help you get started with Stable Diffusion:

Stable Diffusion Ultimate Guide: A comprehensive tutorial covering installation, txt2img, img2img, inpainting, upscalers, and more.

Step-by-Step Quickstart Guide:  A detailed walkthrough of Stable Diffusion’s latest release, including video creation and advanced tweaks.

Crash Course for Beginners: A full course on using Stable Diffusion, including training your own model, using Control Net, and API integration.

 

Wednesday, April 30, 2025

The Business Advantages of Hybrid Web and Desktop Apps with .NET MAUI and Blazor

On April 23, 2025, Rachel Kang presented "Hybrid Web and Desktop apps with .NET MAUI and Blazor" to the Cleveland C# User Group. The video can be found at https://www.youtube.com/watch?v=Eg3XTkctzoE

Although this presentation was targeted to Software developers, the technology itself offers several advantages to businesses that managers and executives need to consider.

 

Businesses need applications that are versatile, scalable, and cost-effective. Enter .NET MAUI and Blazor, a powerful combination that enables developers to build hybrid applications that seamlessly run on both web and desktop platforms. This approach offers numerous advantages to businesses looking to optimize their software solutions.

 

1. Cross-Platform Efficiency

One of the biggest advantages of using .NET MAUI and Blazor is the ability to write code once and deploy it across multiple platforms. Businesses no longer need separate teams for web and desktop development—this unified approach reduces development time and costs while ensuring consistency across different environments.

 

2. Improved User Experience

Hybrid applications built with .NET MAUI and Blazor provide a native-like experience on desktop while maintaining the flexibility of web applications. Users can enjoy fast performance, offline capabilities, and seamless integration with device features, making the application more intuitive and efficient.

 

3. Cost Savings

Developing separate applications for web and desktop can be expensive. With .NET MAUI and Blazor, businesses can leverage a single codebase, reducing development and maintenance costs. This approach also minimizes the need for extensive training, as developers can use familiar C# and .NET technologies.

 

4. Enhanced Security

Security is a top priority for businesses, and hybrid applications offer better control over data and access permissions. Unlike purely web-based applications, desktop components can store sensitive data locally, reducing exposure to online threats while still allowing cloud-based synchronization.

 

5. Seamless Integration with Existing Systems

Many businesses rely on legacy systems and third-party integrations. .NET MAUI and Blazor make it easier to connect with existing databases, APIs, and enterprise solutions, ensuring a smooth transition without disrupting operations.

 

6. Future-Proof Technology

Microsoft continues to invest in .NET MAUI and Blazor, ensuring long-term support and updates. Businesses adopting this technology can stay ahead of the curve, benefiting from continuous improvements and new features.

 

By leveraging .NET MAUI and Blazor, businesses can create powerful, flexible, and cost-effective applications that cater to both web and desktop users. Whether you're looking to streamline development, enhance security, or improve user experience, this hybrid approach is a game-changer.

Tuesday, April 22, 2025

Azure Tenant vs. Azure Directory

In Azure, a tenant refers to a dedicated instance of Microsoft Entra ID (formerly Azure Active Directory) that an organization receives when signing up for a Microsoft cloud service like Azure, Microsoft 365, or Dynamics 365.

 

Azure Tenant

  • Identity Management: A tenant provides a centralized identity system for managing users, groups, and applications.
  • Subscription Association: A tenant can own one or multiple Azure subscriptions, but each subscription belongs to only one tenant.
  • Security & Access Control: Tenants enable role-based access control (RBAC) and authentication across Azure services.
  • Domain Integration: Organizations can associate custom domains with their tenant for branding and authentication
  • Dedicated: a Tenant is a dedicated instance of Microsoft Entra ID (formerly Azure Active Directory) that an organization receives when signing up for a Microsoft cloud service.
  • Boundary: It acts as a boundary for identity management, subscriptions, and resources.
  • Multiple Subscriptions:  A tenant can have multiple subscriptions, but each subscription belongs to only one tenant.

Azure Directory

  • The directory is the identity service within the tenant that stores and manages users, groups, and applications.
  • It enables authentication and access control across Azure services.
  • The Tenant ID and Directory ID are often the same, as they refer to the same identity container.

 

Essentially, the tenant is the overarching entity, while the directory is the identity management system within it

 

For more info, visit https://learn.microsoft.com/en-us/answers/questions/1457968/help-me-to-understand-the-concepts-of-tenant-direc

 

Azure Language Service vs. LLM

This article explains the basic difference between using Azure AI Language Service compared to an LLM (Large Language Model) with a custom prompt.

 

Overview

Using Language Service with Azure Language Studio, the model can be setup to return the user’s intention based on utterances and entities used for training.  It will then return a JSON result set as seen below.

 

 

 

JSON Result Returned:

 

{

    "query": "I want to buy a car\n",

    "prediction": {

        "topIntent": "BuyCar",

        "projectKind": "Conversation",

        "intents": [

            {

                "category": "BuyCar",

                "confidenceScore": 0.8265285

            },

            {

                "category": "None",

                "confidenceScore": 0

            }

        ],

        "entities": []

    }

}

 

The same thing can be accomplished using an LLM in AI Foundry with a simple prompt:

 

 

 

Question: What’s the advantage of using Language Service compared to an LLM if both can provide the same JSON results with LLM having less setup and configuration?

 

Answer:

Here are the key benefits of using Conversational Language Understanding (CLU) from the Language Service instead of an LLM for conversations: 

  • Determinism: Once trained, the output (both the prediction value and the JSON structure) for these custom CLU models are deterministic. There is no risk of hallucination which is more common with other LLMs. 
  • Low Latency: CLU models are lightweight and very fast, often providing a prediction in less than 50ms. 
  • Structured Output: Because CLU is designed for this specific conversational task, customers get a deterministic structured output with the custom intent categories, custom entity recognition, and prebuilt entity recognition.
  • Evaluation Methods: CLU models provide confidence scores for the intent recognition, so customers can choose a confidence threshold for their implementation. CLU also provides detailed evaluation data, including precision, recall, and F1 scores, for testing. 
  • Predictable Costing: Once trained, CLU models are currently billed at a flat rate per 1000 utterances. So, billing is not dependent on a prompt or token size. 
  • Authoring Experience: CLU models can be designed, trained, and deployed directly in a tailored UX experience (in the AI Foundry on May 2025). This can also be done programmatically via our APIs. 
  • On-Prem Availability: CLU models can be hosted in connected and disconnected containers for customers who have on-premise needs. 

 

As for the LLM approach, because LLMs don't require model training or labeling a training dataset, customers can see a decent quality model very quickly (provided that they have access to a high-quality prompt). LLMs are also context-aware and can maintain conversation context throughout a multi-turn conversation. 

 

In my opinion, LLMs can be a great way to demonstrate the conversational AI capabilities at Microsoft, but we find that many customers are looking for more control over the output. Instead, customers often use LLMs to help support their CLU model construction. In fact, we have many more LLM-powered CLU capabilities in our roadmap for this year, including AOAI model deployments with the CLU structured output. 

 

In addition, check out this video by Alan Smith that helps to sum it up.

 

 

Question:  Building on the question above, why use Custom Question Answering (CQA) vs. LLMs with RAG (Retrieval Augmented Generation) ?

 

Answer:

CQA provides a lightweight knowledge base management experience that allows users to define specific answers for specific questions in a CQA project. Then at inference, it returns the exact answers for the question as defined in the project, instead of generative from knowledge base.

 

Benefits of CQA (in the context of LLMs + RAG):

This nature of CQA brings 2 key benefits:

  • It ensures zero hallucination because it returns the exact answers as human authored in the project. 
  • The inference latency is very low because once the model identifies the question, it returns the full answer right away without generation time. 

 

Key scenarios of using CQA (in the context of LLMs + RAG):

The benefits mentioned above optimizes the following key scenarios comparing LLMs with RAG:

  • Answering critical questions where any hallucination is unacceptable (e.g. answers to policies, legal terms, etc.):
    Given all answers in CQA are human reviewed/approved and be returned as it is. 
  • Requiring timely fixes in answers (e.g. When generative answers from RAG are incorrect) that would have greater impact to customers and businesses:
    In CQA it's simply about updating the answer and push to production deployment, comparing to RAG if something wrong it takes time to revisit the quality of the related documents, doc chunking and content retrieval mechanism, etc.

 

In addition, CQA and LLMs using RAG shouldn't been seen either-or options. They should be considered used together to complement each other. E.g.:

  • Use CQA to cover critical questions to ensure zero hallucinations. 
  • Use RAG to cover most of the other questions (which usually is a long tail of all different kinds of questions users may ask that are hard to predict when designing the solution).
  • Leverage CQA to quickly fix the quality issue from RAG of any important answers, esp. as discovered in production when time-to-resolution is critical.

 

Here's an accelerator project that demonstrates this orchestration: Azure-Samples/Azure-Language-OpenAI-Conversational-Agent-Accelerator: A solution accelerator project harnessing the capabilities of Azure AI Language to augment an existing Azure OpenAI RAG chat app. Utilize Conversational Language Understanding (CLU) and Custom Question Answering (CQA) to dynamically improve a RAG chat experience.

 

 

Tuesday, March 25, 2025

DirectML, ML.NET, and CUDA in a nutshell

 

DirectML (Direct Machine Learning) is a low-level API for machine learning.  It was developed by Microsoft as part of its Windows AI platform. DirectML integrates with DirectX 12 compatible hardware. It’s designed to provide hardware-accelerated machine learning capabilities across a wide range of GPUs, not tied to any specific vendor.  DirectML is a low-level hardware abstraction layer that enables machine learning workloads on any DirectX 12 compatible GPU.

 

ML.NET (Machine Learning .NET) is an open source and cross-platform framework also developed by Microsoft.  It provides the capability to train and build custom machine learning models using C# or F#.

ML.NET also provides model building capabilities using various features:

  1. AutoML (automated machine learning) that automatically attempts various algorithms to find the best fit for a given set of data
  2. ML.NET CLI (Command Line Interface) for building models through the command line
  3. Model Builder for building and integrating machine learning models into an application using a GUI interface.

 

CUDA (Compute Unified Device Architecture) is a parallel computing platform and programming model developed by NVIDIA for use exclusively on NVIDIA GPUs. 

It allows developers to use GPUs for deep learning and model building.

CUDA can be used with ML.Net Model Builder: https://learn.microsoft.com/en-us/dotnet/machine-learning/how-to-guides/install-gpu-model-builder

 

DirectML and CUDA are both frameworks used for machine learning and GPU computing, but they have distinct differences.

CUDA is generally faster for deep learning workloads, especially for complex models and large datasets. DirectML, while competitive, may not match CUDA's performance in high-end applications.

DirectML provides a high-level API, making it easier to use for developers. CUDA offers a low-level API, which allows for more fine-tuned control but requires more expertise.

DirectML is a good choice for cross-platform applications or when working with diverse hardware. CUDA is ideal for high-performance tasks on NVIDIA GPUs.

 

 

Friday, February 28, 2025

Phi Family of Small Language Models

Phi models are Small Language Models (SLM) developed by Microsoft.  They’re designed to handle various tasks, including text, image, and speech processing, while requiring less computing power.  The models are open-source, available with the MIT License.

 

The diagram below shows the evolution and capabilities of various Phi models. 

 

 

 

With the recent release of Phi-4 Multimodal model, more features are now available. In addition, here are some of its most notable features:

1. Multimodal Data Processing: Phi-4 Multimodal excels at handling text, images, and speech at the same time. This means it can interpret and generate content across different formats, making it incredibly versatile for various applications.

2. Efficient Performance: Despite its advanced capabilities, Phi-4 Multimodal is designed to be highly efficient. It requires significantly less computing power compared to larger AI systems, making it accessible and practical for a wider range of users and devices.

3. Enhanced Understanding: With its ability to integrate information from different data types, Phi-4 Multimodal offers a deeper and more comprehensive understanding of the context. This leads to more accurate and relevant responses, whether it's generating text, recognizing images, or interpreting speech.

4. Real-Time Processing: One of the most impressive features of Phi-4 Multimodal is its capability to process information in real-time. This is particularly beneficial for applications requiring instant analysis and response, such as virtual assistants, real-time translation, and interactive applications.

5. Customizability: Phi-4 Multimodal is designed with flexibility in mind. Users can tailor its functions and capabilities to suit specific needs, making it a highly customizable tool for developers and businesses.

 

For more info, please visit the Educator Developer Blog

For C# labs using Phi models, visit the PhiCookBook

 

Wednesday, February 26, 2025

Microsoft 365 Copilot Data Q&A

Question:  I need to know if data entered and used in the $30 Copilot service in M365 is secured in the same way that data in the $0 M365 Copilot Chat. I cannot find a reference that explains this. I want to know if my users can use both without the risk of having our content exposed outside of our tenant.

 

Answer: Yes, both the $30 Microsoft 365 Copilot service and the $0 Microsoft 365 Copilot Chat offer the same level of data security and privacy protections. Both services are covered by the same enterprise data protection (EDP) controls and commitments under the Data Protection Addendum (DPA) and Product Terms. Your data is protected with encryption at rest and in transit. Also, Microsoft does not use your data to train foundation models.  In a nutshell, your data remains yours and yours alone. 

For additional references, see the following links:

https://learn.microsoft.com/en-us/copilot/privacy-and-protections

https://learn.microsoft.com/en-us/copilot/microsoft-365/enterprise-data-protection

https://learn.microsoft.com/en-us/copilot/microsoft-365/microsoft-365-copilot-privacy

 

 

Question: What encryption methods are used to secure my data for Microsoft 365 Copilot?

 

Answer: There are multiple encryption methods are used to secure your data:

  1. Encryption at Rest: Data stored in Microsoft 365 is encrypted using BitLocker and Distributed Key Manager (DKM). This ensures that your data is protected even when it is not actively being used.
  2. Encryption in Transit: Data transmitted between your device and Microsoft 365 services is encrypted using Transport Layer Security (TLS). This helps protect your data from interception during transmission.
  3. Sensitivity Labels and Azure Rights Management: Microsoft Purview sensitivity labels and Azure Rights Management provide an extra layer of protection by applying encryption and access controls to your data. This ensures that only authorized users can access sensitive information.

For more information, visit https://learn.microsoft.com/en-us/copilot/microsoft-365/microsoft-365-copilot-architecture-data-protection-auditing

 

 

Question: What other security features does Microsoft 365 Copilot have?

 

Answer: Microsoft 365 Copilot has several security features for data protection:

  1. Advanced Threat Protection: Microsoft 365 Copilot includes advanced threat protection to detect and mitigate potential security threats.  Features like Safe Links and Safe Attachments, help protect against phishing and malware attacks.
  2. Data Loss Prevention (DLP): DLP policies help prevent sensitive information from being shared inappropriately. These policies can be customized.
  3. Identity and Access Management: Microsoft 365 Copilot uses Azure Active Directory (Azure AD) for identity and access management. This includes features like multi-factor authentication (MFA), conditional access policies, and identity protection to help secure user accounts and control access to resources.
  4. Compliance and Auditing: Microsoft 365 Copilot provides comprehensive compliance and auditing. Features like eDiscovery, audit logs, and compliance reports help organizations meet regulatory requirements and monitor user activity.
  5. Information Protection: Microsoft Purview sensitivity labels and encryption provide an extra layer of protection for your data, applied to documents, emails, and other content.
  6. Oversharing Controls: Microsoft 365 Copilot includes controls to prevent oversharing of data in SharePoint sites and OneDrive.

For more information, visit Microsoft 365 Copilot security documentation.

 

Thursday, January 30, 2025

DeepSeek R1 in a Nutshell

DeepSeek R1 is an advanced AI model developed by the Chinese startup DeepSeek AI. It has gained significant attention for the following reasons:

  • Open Source, available to for use by anyone.
  • Comparable Performance to OpenAI's GPT-4 and ChatGPT o1 models on various benchmarks.
  • DeepSeek R1 was reportedly trained on 2,788 GPUs at a cost of around $6 million, significantly less than the estimated $100 million cost to train OpenAI's GPT-4.
  • Excels in reasoning tasks and has been trained using large-scale reinforcement learning without supervised fine-tuning.
  • Availability on platforms like Azure AI Foundry and GitHub, making it accessible for developers and researchers.
  • DeepSeek R1's open-source nature and cost-effective training have made it a notable player in the AI community, challenging the notion that larger models and more data always lead to better performance.

 

To get started, DeepSeek R1 is now available via a serverless endpoint through the model catalog in Azure AI Foundry.

Also, check out the GitHub Models blog post, where you can explore additional resources and step-by-step guides to integrate DeepSeek R1 seamlessly into your applications.

In addition, customers will be able to use distilled flavors of the DeepSeek R1 model to run locally on their Copilot+ PCs, as noted in the Windows Developer blog post.

 

What is Automated Intelligence?

Automated Intelligence refers to the use of technology to automate repetitive, rule-based tasks that typically require minimal human intervention. This includes everything from data entry to workflow management and beyond. The goal of Automated Intelligence is to streamline processes, increase efficiency, and reduce the potential for human error.

 

Artificial Intelligence encompasses a broader scope, including machine learning, natural language processing, and more. AI is designed to simulate human intelligence and can perform complex tasks like understanding language, recognizing patterns, and making decisions based on data. AI systems can learn and adapt over time, improving their performance with more data and experience.

 

Automated Intelligence (AI) and Artificial Intelligence (AI). Although they share the same abbreviation, their applications and implications can differ significantly.

- Scope: Automated Intelligence focuses on automating specific tasks, while Artificial Intelligence aims to replicate human-like intelligence across a wide range of activities.

- Learning Capability: AI systems can learn and evolve, whereas Automated Intelligence typically follows predefined rules and processes without learning capabilities.

- Application: Automated Intelligence is often used for straightforward, repetitive tasks, while Artificial Intelligence tackles more complex and dynamic problems.

 

How Automated Intelligence Can Transform Business Processes:

1. Efficiency Boost: Automating routine tasks frees up employees to focus on higher-value activities, leading to increased productivity.

2. Consistency and Accuracy: By minimizing human intervention, businesses can reduce errors and ensure consistent output quality.

3. Cost Savings: Automation can reduce labor costs and streamline operations, resulting in significant cost savings over time.

4. Scalability: Automated processes can easily be scaled to handle increased workloads without the need for proportional increases in resources.

 

 

Friday, January 10, 2025

"Data Science with .NET and Polyglot Notebooks" By Matt Eland

In the fall of 2024, I had the opportunity to work with Matt Eland and be one of the editors for his book “Data Science with .NET and Polyglot Notebooks: Programmer's guide to data science using ML.NET, OpenAI, and Semantic Kernel”.  Matt is a very intelligent and knowledgeable data science developer and it definitely reflected in his work.  He walks the reader through step-by-step directions to demonstrate key concepts in data science, machine learning, as well as polyglot notebooks.  This was one of the rare books that I could hardly put down.  I urge you to pick-up a copy and upgrade your data science skills.

 

 

 

Thursday, January 9, 2025

Recap of "How To Tune A Multi-Terabyte Database For Optimum Performance"

On October 29, 2024 at the GroupBy conference, I was moderator for Jeff Taylor's session "How To Tune A Multi-Terabyte Database For Optimum Performance"

The video is available at https://www.youtube.com/watch?v=9j51bD0DPZE

 

Listed below are some take aways and Q&As from his session:

 

Ideal Latency time:

20ms for IO

10ms for TempDB

 

Crystal Disk Mark is a simple disk benchmark software: https://crystalmark.info/en/software/crystaldiskmark/

 

What is the overhead of running these diagnostics (i.e. diskspd and Crystal Disk)?

No adverse effects during mid-day testing, but don't run it during a busy time.

It's best to test it during both busy and non-busy times

 

Mutlipath: multiple network cards between host, switch and SAN appliance

 

For tempdb storage, what's preferable?

Shared space on a disk pool with a lot of drives or dedicated pool with just 2 drives (raid 1)? all drives of the same type (NVMe). 

"Shared" means with other databases

Run in memory for newer versions

Raid10 will be fastest

keep tempDB separate from other DBs

 

By in memory tempdb, does that mean memory optimized tempdb metadata option? Yes

 

Jumbo Frames are 8192 when enabled, should be used for storage network to avoid issues

to transfer more across the network

 

 

Raid 5 is best for economy/performance combination on both SSD and conventional drives

 

RAID 5 for data? What about that write penalty overhead? Why not RAID 10 ? RAID 10 is best but RAID 5 will sufficiently perform but make sure you have enough memory for operational needs

 

Use New Mbsv3 series VMs from Azure

 

Would you consider local raid0 for tempdb? Yes, you can but RAID 1 so it's redundant so it stays live.

 

nvarchar: N for "National" characters for various foreign languages, 2+ bytes per character

 

Prefer to use INT instead of BigInt

 

Datetime2 (8 bytes) is preferred over Datetime(6-8 bytes)

 

Unicode size on disk is one thing, size when in cache is a worse problem

 

What do you think about using IFI (Instant File Initialization) for log file in 2022?  Recommended

 

Avoid Heap tables.  However, Markus Winand, author or SQL Performance Explained, shows some specialized cases where Heap is better.

See https://medium.com/@nhatcuong/sql-performance-explained-by-markus-winand-some-notes-after-the-first-read-1dde208f2fd7 for more info