Skip to main content
Redhat Developers  Logo
  • Products

    Featured

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat OpenShift AI
      Red Hat OpenShift AI
    • Red Hat Enterprise Linux AI
      Linux icon inside of a brain
    • Image mode for Red Hat Enterprise Linux
      RHEL image mode
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • Red Hat Developer Hub
      Developer Hub
    • View All Red Hat Products
    • Linux

      • Red Hat Enterprise Linux
      • Image mode for Red Hat Enterprise Linux
      • Red Hat Universal Base Images (UBI)
    • Java runtimes & frameworks

      • JBoss Enterprise Application Platform
      • Red Hat build of OpenJDK
    • Kubernetes

      • Red Hat OpenShift
      • Microsoft Azure Red Hat OpenShift
      • Red Hat OpenShift Virtualization
      • Red Hat OpenShift Lightspeed
    • Integration & App Connectivity

      • Red Hat Build of Apache Camel
      • Red Hat Service Interconnect
      • Red Hat Connectivity Link
    • AI/ML

      • Red Hat OpenShift AI
      • Red Hat Enterprise Linux AI
    • Automation

      • Red Hat Ansible Automation Platform
      • Red Hat Ansible Lightspeed
    • Developer tools

      • Red Hat Trusted Software Supply Chain
      • Podman Desktop
      • Red Hat OpenShift Dev Spaces
    • Developer Sandbox

      Developer Sandbox
      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Openshift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • View All Technologies
    • Programming Languages & Frameworks

      • Java
      • Python
      • JavaScript
    • System Design & Architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer Productivity

      • Developer productivity
      • Developer Tools
      • GitOps
    • Secure Development & Architectures

      • Security
      • Secure coding
    • Platform Engineering

      • DevOps
      • DevSecOps
      • Ansible automation for applications and services
    • Automated Data Processing

      • AI/ML
      • Data Science
      • Apache Kafka on Kubernetes
      • View All Technologies
    • Start exploring in the Developer Sandbox for free

      sandbox graphic
      Try Red Hat's products and technologies without setup or configuration.
    • Try at no cost
  • Learn

    Featured

    • Kubernetes & Cloud Native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • Java
      Java icon
    • AI/ML
      AI/ML Icon
    • View All Learning Resources

    E-Books

    • GitOps Cookbook
    • Podman in Action
    • Kubernetes Operators
    • The Path to GitOps
    • View All E-books

    Cheat Sheets

    • Linux Commands
    • Bash Commands
    • Git
    • systemd Commands
    • View All Cheat Sheets

    Documentation

    • API Catalog
    • Product Documentation
    • Legacy Documentation
    • Red Hat Learning

      Learning image
      Boost your technical skills to expert-level with the help of interactive lessons offered by various Red Hat Learning programs.
    • Explore Red Hat Learning
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

How InstructLab enables accessible model fine-tuning for gen AI

August 5, 2024
Cedric Clyburn Legare Kerrison
Related topics:
Artificial intelligenceData ScienceDeveloper ToolsLinuxOpen source
Related products:
Developer ToolsRed Hat Enterprise Linux AI

Share:

    Adapting large language models (LLMs) for specific use cases traditionally requires extensive resources and expertise. While Gartner says more than 80% of enterprises will have deployed generative AI-enabled applications by 2026, the challenge of customizing these models for domain-specific tasks remains significant. InstructLab, an open source project developed by IBM and Red Hat, aims to address this gap by democratizing LLM tuning. 

    Let’s take a look at how InstructLab enables developers (and domain experts) to enhance and specialize language models efficiently, even on consumer-grade hardware, potentially accelerating the adoption of tailored AI solutions across industries. 

    This article is accompanied by a conference presentation given by Legare Kerrison and Cedric Clyburn at WeAreDevelopers World Congress 2024, which can be viewed below.

    What are some of the limitations of LLMs?

    Despite their impressive capabilities, current LLMs face several critical limitations that hinder their effectiveness in specialized domains:

    1. Knowledge cut-off: Models are constrained by their training data, often leading to outdated information.
    2. Lack of transparency: It’s often unclear how these models arrive at their conclusions, which can lead to trust issues.
    3. False information: LLMs can generate convincing but incorrect responses.
    4. Lack of domain knowledge: Generalist models might not have the specific knowledge required for particular industries. Only a limited amount of enterprise knowledge is represented in LLMs.
    5. Explainability: Understanding why a model made a particular decision can be difficult.

    These challenges highlight the need, and use cases, for more targeted approaches to better align your model to your expectations. When pre-trained and generalistic LLMs don’t meet your needs out of the box, what techniques can you use to improve their overall effectiveness, accuracy, and performance?

    Techniques to enhance Generative AI models

    To address the limitations of large language models, several key techniques have emerged:

    • Pre-training and fine-tuning: While most companies don’t have the computational resources to engage in pre-training of a foundational model, fine-tuning typically involves taking an existing open-source model and conducting additional training for specific use cases. While effective, it's often resource-intensive, requiring significant computational power and time. The process usually entails forking the original model, which can make it challenging to incorporate improvements back into the main model version.
    • Grounding (retrieval augmented generation): This provides models with relevant external data to perform specific tasks. Unlike the previous methods, RAG doesn't actually improve the underlying model. Instead, it supplements the model's knowledge by retrieving and incorporating pertinent information at runtime. While this approach can enhance accuracy for specific queries, it doesn't inherently make the model more capable or knowledgeable. 

    Figure 1 depicts these enhancements techniques.

    A chart depicting various ways to enhance LLMs. The left column is labelled Method and three boxes labelled Pre-training and Fine-tuning, Alignment Tuning, and Grounding (Retrieval Augmented Generation) are stacked below it. The right column is labelled What does it do? and describes each of the aforementioned techniques.
    Figure 1: Various ways to enhance the output and accuracy of Large Language Models
    Figure 1: Various ways to enhance the output and accuracy of large language models.

    These techniques offer distinct advantages and can be particularly suited to different scenarios (or combined, in the case of fine-tuning and RAG). Fine-tuning excels at task-specific optimization, but traditionally at higher resource cost. RAG offers flexibility and up-to-date information, but requires an efficient pipeline and is simply supplementing the base model with information, not improving it.

    Case study: Your foundation model’s impact on cost

    Regardless of the method used to enhance a model, the choice of your foundation model can significantly impact the overall cost, performance, and efficiency of your AI solution. In Maryam Ashoori, PhD at IBM Watson’s case study, she illustrates the implications your chosen base model has on cost. Say that you would like to select an LLM to generate 500-word meeting summaries for a company with 700 employees, assuming each employee attends 5, 30-minute meetings daily, with 3 employees in each meeting. If we were to have a 52B Parameter General Purpose LMM do this, it would cost $0.09 per summary, adding up to $105 a day and to $38,325 per year. If you instead fine-tuned a smaller 3B Parameter Model hosted on Watsonx.AI, it would cost you $0.0039996 per summary, for a total of $1,702.19 a year plus a one-time $1,152 model tuning cost, equaling $2,854 per year. This means that using the fine-tuned LLM came out to be 14x cheaper than using the Large General LLM, as shown in Figure 2.

    An image comparing and contrasting the cost effectiveness of a Large General-Purpose LLM and a Fine-Tuned Smaller LLM, which shows that the Fine-Tuned Smaller LLM is 14 times cheaper annually.
    Figure 2: Model selection and training impact on cost
    Figure 2: Model selection and training impact on cost.

    Using InstructLab for accessible model fine-tuning

    InstructLab provides a powerful framework for making LLM fine-tuning more accessible, and was designed to democratize the tuning and development of models for those without a data science background. InstructLab’s process is akin to having a teacher and a critic model working together to train the AI, ensuring the model is tailored to your specific domain, improving accuracy and relevance. This is possible through several key components, detailed in Figure 3:

    • Taxonomy-driven data curation: The project organizes skills and knowledge into a structured folder-style directory, which helps identify and address specific gaps in the model’s capabilities.
    • Large-scale synthetic data generation: Based on the initial user-defined examples, InstructLab creates additional diverse and high-quality training data.
    • Multi-phase training: The new knowledge and skills are incorporated into the data in layered phases.
    An image comparing the three key components (Taxonomy-driven Data Curation, Large-scale Synthetic Data Generation, and Model Training with New Data) that make up the InstructLab project. Each component is represented by an abstract purple icon.
    Figure 3: Key components that make up the InstructLab project
    Figure 3: Key components that make up the InstructLab project.

    Once an individual has trained a model for their specific use case, they can then have their training data integrated with Instructlab’s community model through a pull request triage system. This open source methodology enables all to have a say in the future of model contributions and development, fostering a collaborative environment where diverse expertise and perspectives can shape AI development.

    Conclusion

    As AI continues to evolve, techniques like InstructLab are bridging the gap between cutting-edge AI research and practical, enterprise-ready applications. By making LLM tuning more accessible to individual users and organizations, we can overcome some of the limitations around models and create more accurate, reliable, and specialized AI solutions. 

    We believe the future of AI is collaborative and open. Whether you’re fine-tuning your own model or contributing to a shared community model that others can use, you’re helping to democratize AI. To get started with InstructLab, check out the GitHub repository for installation instructions on your system, and follow InstructLab on X and LinkedIn for updates about the project!

    Last updated: October 28, 2024

    Related Posts

    • Getting started with InstructLab for generative AI model tuning

    • InstructLab: Advancing generative AI through open source

    • Apply generative AI to app modernization with Konveyor AI

    • Introducing Podman AI Lab: Developer tooling for working with LLMs

    • TrustyAI Detoxify: Guardrailing LLMs during training

    Recent Posts

    • More Essential AI tutorials for Node.js Developers

    • How to run a fraud detection AI model on RHEL CVMs

    • How we use software provenance at Red Hat

    • Alternatives to creating bootc images from scratch

    • How to update OpenStack Services on OpenShift

    What’s up next?

    Learn how to access a large language model using Node.js and LangChain.js. You’ll also explore LangChain.js APIs that simplify common requirements like retrieval-augmented generation (RAG).

    Start the activity
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Products

    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform

    Build

    • Developer Sandbox
    • Developer Tools
    • Interactive Tutorials
    • API Catalog

    Quicklinks

    • Learning Resources
    • E-books
    • Cheat Sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site Status Dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue