{"id":2973,"date":"2024-03-28T09:35:23","date_gmt":"2024-03-28T09:35:23","guid":{"rendered":"https:\/\/favtutor.com\/articles\/?p=2973"},"modified":"2024-03-29T08:46:21","modified_gmt":"2024-03-29T08:46:21","slug":"stable-code-instruct-3b","status":"publish","type":"post","link":"https:\/\/favtutor.com\/articles\/stable-code-instruct-3b\/","title":{"rendered":"Stable Code Instruct 3B Explained: The New AI Coding Asset"},"content":{"rendered":"\n<p>Stability AI just released Stable Code Instruct 3B, an instruction-tuned Code Language Model based on Stable Code 3B. By using natural language prompting, Instruct 3B can handle various tasks such as code generation, software development, and mathematics-related queries. Let\u2019s look at how Stable Code Instruct 3B works.<\/p>\n\n\n\n<p><strong>Highlights:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Stability AI just released Stable Code Instruct 3B, an instruction-tuned Code Language Model that can handle tasks such as code generation, software development, and math operations.<\/li>\n\n\n\n<li>It outperforms comparable models such as Codellama 7B Instruct, and DeepSeek-Coder Instruct 1.3B in various coding-related tasks.<\/li>\n\n\n\n<li>The weights and code for Stable Code Instruct 3D are available publicly on HuggingFace from where users can test it model for non-commercial uses.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is Stable Code Instruct 3B?<\/strong><\/h2>\n\n\n\n<p><strong>Stable Code Instruct 3B is Stability AI\u2019s latest instruction-tuned large language model (LLM), built on top of Stable Code 3B.<\/strong> This model enhances code completion and has support for natural language interactions, aiming to improve the efficiency of programming, math, and software development related tasks.<\/p>\n\n\n\n<p>Stability AI <a href=\"https:\/\/stability.ai\/news\/introducing-stable-code-instruct-3b\" target=\"_blank\" rel=\"noopener\">introduced the Instruct 3B model<\/a> with the following post on X:<\/p>\n\n\n\n<div align=\"center\"><blockquote class=\"twitter-tweet\" data-media-max-width=\"560\"><p lang=\"en\" dir=\"ltr\">Introducing Stable Code Instruct 3B, our new instruction tuned LLM based on Stable Code 3B. With natural language prompting, this model can handle a variety of tasks such as code generation, math and other software engineering related outputs.<br><br>This model\u2019s performance rivals\u2026 <a href=\"https:\/\/t.co\/RsZhKpWu57\" target=\"_blank\">pic.twitter.com\/RsZhKpWu57<\/a><\/p>&mdash; Stability AI (@StabilityAI) <a href=\"https:\/\/twitter.com\/StabilityAI\/status\/1772345514023116828?ref_src=twsrc%5Etfw\" target=\"_blank\" rel=\"noopener\">March 25, 2024<\/a><\/blockquote> <script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/div>\n\n\n\n<p>Stability AI\u2019s analysis suggests that Instruct 3B outperforms comparable models like Codellama 7B Instruct and DeepSeek-Coder Instruct 1.3B in several coding-related tasks. Stable Code Instruct also exhibits state-of-the-art (SOTA) performance on the MT-Bench coding tasks and Multi-PL completion compared to other instruction-tuned models.<\/p>\n\n\n\n<p>Their analysis suggests that Stable Code Instruct 3B outperforms comparable models such as Codellama 7B Instruct, and DeepSeek-Coder Instruct 1.3B in various coding-related tasks.<\/p>\n\n\n\n<p>The model is available with a Stability AI Membership for commercial use. The weights and code for Stable Code Instruct 3B are now available on Hugging Face. Users can test the model for free using HuggingFace and can download the weights and code for non-commercial use.<\/p>\n\n\n\n<p>What can Stable Code Instruct 3B do? Here&#8217;s the list:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Automated Code Completion<\/li>\n\n\n\n<li>Insertion of Missing Code Snippets<\/li>\n\n\n\n<li>Code Generation for Database Interaction<\/li>\n\n\n\n<li>Translation of Programming Languages<\/li>\n\n\n\n<li>Explanation of Code Functionality<\/li>\n\n\n\n<li>Code Generation Based on User Instructions<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Training Data for Stable Code Instruct 3B<\/strong><\/h3>\n\n\n\n<p>To make the pre-training dataset for Stable Code, the team gathered diverse data from various publicly available sources, including code repositories, technical documents, mathematical texts, and extensive web datasets. <\/p>\n\n\n\n<p>The primary aim of this initial pretraining phase was to develop a comprehensive internal representation that goes beyond mere code understanding. Their goal was to significantly enhance the model&#8217;s proficiency in mathematical comprehension, logical reasoning, and processing complex technical texts related to software development.<\/p>\n\n\n\n<p>By selecting such a diverse dataset mix, they aimed to create a language model well-equipped to handle a wide range of software engineering tasks, not limited to code completion alone. Additionally, the training data incorporates general text datasets to provide the model with broader linguistic knowledge and context.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1) Synthetic Dataset<\/strong><\/h3>\n\n\n\n<p>They incorporated a small synthetic dataset into the pre-training corpus, generated from the seed prompts of the CodeAlpaca dataset, consisting of 174,000 prompts. To enhance the diversity and complexity of the prompts, they utilized the &#8220;Evol-Instruct&#8221; method<\/p>\n\n\n\n<p>This method involves progressively increasing the complexity of seed prompts using a language model, in this case, WizardLM, through strategies that focus on breadth, reasoning, deepening, and complexity.<\/p>\n\n\n\n<p>As a result, they augmented the dataset with an additional 100,000 prompts. They employed the DeepSeek Coder 34B model to generate synthetic outputs for the newly developed &#8220;Evol-Instruct&#8221; prompts. This early introduction of synthetic data during the pretraining phase aimed to improve the model&#8217;s ability to respond to natural language text.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2) Long-Context Dataset<\/strong><\/h3>\n\n\n\n<p>Expanding upon the initial pre-training phase, they also developed an additional training stage focused on enhancing the model&#8217;s ability to process and understand long sequences, particularly beneficial for coding models dealing with multiple files within a repository.<\/p>\n\n\n\n<p>After analyzing the median and mean token counts in software repositories, they determined a context length of 16,384 tokens.<\/p>\n\n\n\n<p>In this stage, they utilized a curated selection of programming languages from The Starcoder dataset, including programming languages such as Python, Java, Javascript, C, C++, and GoLang based on the insights provided by the <a href=\"https:\/\/survey.stackoverflow.co\/2023\/#section-most-popular-technologies-programming-scripting-and-markup-languages\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">2023 Stack Overflow Developer Survey<\/a>. <\/p>\n\n\n\n<p>These are the languages that are most used by developers. Apart from these languages, they also included training for different broadly adopted languages like SQL, PHP, and Rust.<\/p>\n\n\n\n<p>The long context dataset was created by combining files from these languages within a repository, with a special &lt;repo_continuation> token inserted between each file for separation while maintaining content flow. They employed a randomized strategy to generate two distinct orderings for each repository to avoid potential biases from fixed file orderings.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Multi-Stage Training<\/strong><\/h3>\n\n\n\n<p>They adopted a staged training methodology, a strategy commonly employed in other similar strong code language models like CodeGen, Stable Code Alpha, CodeLLaMA, and DeepSeekCoder models. In training Stable Code, they utilize standard autoregressive sequence modelling to predict the next token.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"267\" src=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Multi-Stage-Training-1024x267.png\" alt=\"Multi-Stage Training\" class=\"wp-image-2974\" srcset=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Multi-Stage-Training-1024x267.png 1024w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Multi-Stage-Training-300x78.png 300w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Multi-Stage-Training-768x200.png 768w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Multi-Stage-Training-750x196.png 750w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Multi-Stage-Training.png 1077w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>The model has been initialized from the Stable LM 3B checkpoint, with a base context length of 4096 for the initial training stage, incorporating the specified data mix. Subsequently, a continued pretraining stage follows, as illustrated in the figure below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Fill in the Middle (FIM) Training<\/strong><\/h3>\n\n\n\n<p>Utilizing the &#8220;Fill in the Middle&#8221; (FIM) objective is a strategy adopted to address the challenge posed by the non-linear ordering of tokens in code, which often deviates from the left-to-right causal ordering observed in natural language. <\/p>\n\n\n\n<p>This approach involves randomly dividing a document into three segments &#8211; prefix, middle, and suffix &#8211; and then relocating the middle segment to the end of the document before continuing with the autoregressive training process.<\/p>\n\n\n\n<p>By doing so, the model can learn to condition structural patterns beyond the traditional prefix-only format typical in causal language modelling.<\/p>\n\n\n\n<p>The data augmented through this process is categorized into two modes: &#8220;Suffix-Prefix-Middle&#8221; (SPM) and &#8220;Prefix-Suffix-Middle&#8221; (PSM), with FIM applied at the character level with a rate of 50%, and the choice between SPM and PSM modes determined uniformly.<\/p>\n\n\n\n<p>This FIM approach is implemented during both stages of pretraining. To ensure consistency with FIM in the long context training phase, precautions are taken to restrict its application within individual files, thus preventing the introduction of unrealistic scenarios into the training objective.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Fine-tuning and Alignment<\/strong><\/h3>\n\n\n\n<p>After completing pre-training, the model&#8217;s abilities are further enhanced through a fine-tuning stage, which involves both Supervised Fine-Tuning (SFT) and Direct Preference Optimization (DPO).<\/p>\n\n\n\n<p>For SFT, publicly available datasets such as OpenHermes, Code Feedback, and CodeAlpaca are utilized, providing approximately 500,000 training samples post-dedication.<\/p>\n\n\n\n<p>Following SFT, DPO is applied, leveraging a dataset of approximately 7,000 samples curated from UltraFeedback and Distilabel Capybara DPO-7k Binarized. To ensure model safety, samples related to code are filtered using an LLM-based approach, and additional datasets like Helpful and Harmless RLFH are included.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Results<\/strong><\/h3>\n\n\n\n<p>The main benchmark used for comparison is the model&#8217;s proficiency in code completion tasks, which is crucial for assessing its practical applicability in code-related contexts. They use the Multi-PL benchmark as the standardized evaluation metric for these assessments.<\/p>\n\n\n\n<p>The image below shows the performance of Code Instruct 3B versus other similar instruction-tuned LLMs with 3B parameters.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"694\" height=\"389\" src=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-Comparison.png\" alt=\"Stable Code Instruct 3B Comparison\" class=\"wp-image-2975\" srcset=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-Comparison.png 694w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-Comparison-300x168.png 300w\" sizes=\"(max-width: 694px) 100vw, 694px\" \/><\/figure>\n<\/div>\n\n\n<p>They also evaluated instruction-tuned models on the code subset of the challenging Multi-turn benchmark (MT-Bench). The image below shows the results of coding questions in MT-Bench.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"292\" src=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/MT-Bench-Stable-Code-Instruct-3B-Comparison-1024x292.png\" alt=\"MT Bench Stable Code Instruct 3B Comparison\" class=\"wp-image-2976\" srcset=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/MT-Bench-Stable-Code-Instruct-3B-Comparison-1024x292.png 1024w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/MT-Bench-Stable-Code-Instruct-3B-Comparison-300x86.png 300w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/MT-Bench-Stable-Code-Instruct-3B-Comparison-768x219.png 768w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/MT-Bench-Stable-Code-Instruct-3B-Comparison-750x214.png 750w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/MT-Bench-Stable-Code-Instruct-3B-Comparison-1140x325.png 1140w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/MT-Bench-Stable-Code-Instruct-3B-Comparison.png 1196w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>Another important application for code language models is database query tasks. For this, they compared the performance of Stable Code Instruct 3B against other popular instruction-tuned models and models specifically trained to perform well in SQL. <\/p>\n\n\n\n<p>They use the benchmark created by Defog AI to evaluate the models. The results are shown in the table below.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"170\" src=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Defog-AI-Stable-Code-Instruct-3B-Comparison-1024x170.png\" alt=\"Defog AI Stable Code Instruct 3B Comparison\" class=\"wp-image-2977\" srcset=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Defog-AI-Stable-Code-Instruct-3B-Comparison-1024x170.png 1024w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Defog-AI-Stable-Code-Instruct-3B-Comparison-300x50.png 300w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Defog-AI-Stable-Code-Instruct-3B-Comparison-768x128.png 768w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Defog-AI-Stable-Code-Instruct-3B-Comparison-750x125.png 750w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Defog-AI-Stable-Code-Instruct-3B-Comparison.png 1046w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Examples<\/strong><\/h2>\n\n\n\n<p>Let\u2019s test Code Instruct 3B through <a href=\"https:\/\/huggingface.co\/spaces\/stabilityai\/stable-code-instruct-3b\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">HuggingFace<\/a>. You will see an interface that looks like this:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"534\" src=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-1024x534.png\" alt=\"Stable Code Instruct Chat Demo\" class=\"wp-image-2978\" srcset=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-1024x534.png 1024w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-300x156.png 300w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-768x401.png 768w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-1536x801.png 1536w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-750x391.png 750w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-1140x595.png 1140w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo.png 1574w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"443\" src=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-2-1024x443.png\" alt=\"Stable Code Instruct Chat Demo 2\" class=\"wp-image-2979\" srcset=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-2-1024x443.png 1024w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-2-300x130.png 300w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-2-768x332.png 768w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-2-1536x664.png 1536w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-2-750x324.png 750w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-2-1140x493.png 1140w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-Chat-Demo-2.png 1555w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p><strong>Prompted the model to complete the code for the bubble sort algorithm. Here, the model successfully performs FIM (Fill in the middle):<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"541\" src=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-1024x541.png\" alt=\"Stable Code Instruct 3B bubble sort algorithm using FIM\" class=\"wp-image-2980\" srcset=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-1024x541.png 1024w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-300x159.png 300w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-768x406.png 768w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-1536x812.png 1536w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-750x397.png 750w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-1140x603.png 1140w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM.png 1549w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"659\" src=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-3-1024x659.png\" alt=\"Stable Code Instruct 3B bubble sort algorithm using FIM 3\" class=\"wp-image-2982\" srcset=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-3-1024x659.png 1024w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-3-300x193.png 300w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-3-768x494.png 768w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-3-750x483.png 750w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-3-1140x733.png 1140w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-3.png 1486w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p><strong>Prompted the model to explain a code snippet:<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"670\" src=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-2-1024x670.png\" alt=\"Prompted the model to explain a code snippet:\" class=\"wp-image-2981\" srcset=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-2-1024x670.png 1024w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-2-300x196.png 300w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-2-768x503.png 768w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-2-750x491.png 750w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-2-1140x746.png 1140w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Stable-Code-Instruct-3B-bubble-sort-algorithm-using-FIM-2.png 1454w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p><strong>Prompted the model to complete an incomplete SQL code:<\/strong><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"571\" src=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Prompted-the-model-to-complete-an-incomplete-SQL-code-1024x571.png\" alt=\"Prompted the model to complete an incomplete SQL code\" class=\"wp-image-2983\" srcset=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Prompted-the-model-to-complete-an-incomplete-SQL-code-1024x571.png 1024w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Prompted-the-model-to-complete-an-incomplete-SQL-code-300x167.png 300w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Prompted-the-model-to-complete-an-incomplete-SQL-code-768x428.png 768w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Prompted-the-model-to-complete-an-incomplete-SQL-code-750x418.png 750w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Prompted-the-model-to-complete-an-incomplete-SQL-code-1140x636.png 1140w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/Prompted-the-model-to-complete-an-incomplete-SQL-code.png 1454w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p>Stable Code Instruct 3B delivers strong test performance even in languages that were not initially included in the training set, such as Lua. The example below shows how the model can provide a simple code in the Lua language. <\/p>\n\n\n\n<p>This proficiency may stem from its understanding of the underlying coding principles and its ability to adapt these concepts across diverse programming environments.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"630\" src=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/sampe-code-in-the-Lua-language-1024x630.png\" alt=\"sampe code in the Lua language\" class=\"wp-image-2984\" srcset=\"https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/sampe-code-in-the-Lua-language-1024x630.png 1024w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/sampe-code-in-the-Lua-language-300x185.png 300w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/sampe-code-in-the-Lua-language-768x473.png 768w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/sampe-code-in-the-Lua-language-750x462.png 750w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/sampe-code-in-the-Lua-language-1140x702.png 1140w, https:\/\/favtutor.com\/articles\/wp-content\/uploads\/2024\/03\/sampe-code-in-the-Lua-language.png 1465w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Stable Code Instruct 3B represents a significant advancement in instruction-tuned Code Language Models, excelling in code generation, FIM (Fill in the middle) tasks, database queries, translation, explanation, and creation. <\/p>\n\n\n\n<p>Its instruction comprehension enables diverse coding tasks beyond completion, with superior performance across standard benchmarks promising transformative impacts in the field of software engineering.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Find out everything about Stable Code Instruct 3B by Stability AI, an instruction-tuned Model for code generation and software development.<\/p>\n","protected":false},"author":18,"featured_media":2986,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jnews-multi-image_gallery":[],"jnews_single_post":null,"jnews_primary_category":{"id":"","hide":""},"footnotes":""},"categories":[57],"tags":[56,59,74,136,135],"class_list":["post-2973","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","tag-ai","tag-generative-ai","tag-stability-ai","tag-stable-code","tag-stable-code-instruct-3b"],"_links":{"self":[{"href":"https:\/\/favtutor.com\/articles\/wp-json\/wp\/v2\/posts\/2973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/favtutor.com\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/favtutor.com\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/favtutor.com\/articles\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/favtutor.com\/articles\/wp-json\/wp\/v2\/comments?post=2973"}],"version-history":[{"count":2,"href":"https:\/\/favtutor.com\/articles\/wp-json\/wp\/v2\/posts\/2973\/revisions"}],"predecessor-version":[{"id":2987,"href":"https:\/\/favtutor.com\/articles\/wp-json\/wp\/v2\/posts\/2973\/revisions\/2987"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/favtutor.com\/articles\/wp-json\/wp\/v2\/media\/2986"}],"wp:attachment":[{"href":"https:\/\/favtutor.com\/articles\/wp-json\/wp\/v2\/media?parent=2973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/favtutor.com\/articles\/wp-json\/wp\/v2\/categories?post=2973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/favtutor.com\/articles\/wp-json\/wp\/v2\/tags?post=2973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}