<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by FHIRFLY on Medium]]></title>
        <description><![CDATA[Stories by FHIRFLY on Medium]]></description>
        <link>https://medium.com/@fhirfly?source=rss-e9f3874abea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*04sdzhzO86y27R61FnBkUg.png</url>
            <title>Stories by FHIRFLY on Medium</title>
            <link>https://medium.com/@fhirfly?source=rss-e9f3874abea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 06:06:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fhirfly/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Revolutionizing Healthcare Data Security with Threshold Cryptography]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-link"><a href="https://medium.com/@fhirfly/revolutionizing-healthcare-data-security-with-threshold-cryptography-7ee76fe7e748?source=rss-e9f3874abea------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@fhirfly/revolutionizing-healthcare-data-security-with-threshold-cryptography-7ee76fe7e748?source=rss-e9f3874abea------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ee76fe7e748</guid>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[fhir]]></category>
            <category><![CDATA[heathcare]]></category>
            <dc:creator><![CDATA[FHIRFLY]]></dc:creator>
            <pubDate>Thu, 12 Oct 2023 23:59:51 GMT</pubDate>
            <atom:updated>2023-10-12T23:59:51.391Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Understanding Tokens in the Context of Large Language Models like BERT and T5]]></title>
            <link>https://medium.com/@fhirfly/understanding-tokens-in-the-context-of-large-language-models-like-bert-and-t5-8aa0db90ef39?source=rss-e9f3874abea------2</link>
            <guid isPermaLink="false">https://medium.com/p/8aa0db90ef39</guid>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[FHIRFLY]]></dc:creator>
            <pubDate>Wed, 06 Sep 2023 12:40:21 GMT</pubDate>
            <atom:updated>2023-09-06T12:40:21.607Z</atom:updated>
            <content:encoded><![CDATA[<p>## Introduction</p><p>Tokens are fundamental building blocks in the world of Natural Language Processing (NLP) and Large Language Models (LLMs) like BERT, GPT, and T5. These tokens serve as the input units that these models read, process, and generate outputs from. This article aims to provide a detailed understanding of what tokens are, how they function within LLMs, and why they are crucial for the performance and capabilities of these models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*vsi1EgBJac9Qce12cBdKXg@2x.jpeg" /></figure><p>## What is a Token?</p><p>In the context of LLMs, a token can be as small as a single character or as long as a word. In some sophisticated models, tokens can even represent entire phrases. Essentially, tokens are the pieces of text that language models read and analyze. They serve as the primary input data that these models use to perform tasks ranging from text classification to language generation.</p><p>## Tokenization Process</p><p>Before an LLM can process text, it must be broken down into tokens through a process called tokenization. Different models have their ways of tokenizing text:</p><ul><li>**Word-based Tokenization**: Each word is a separate token.</li><li>. Example: “ChatGPT is great!” becomes [‘ChatGPT’, ‘is’, ‘great’, ‘!’]</li><li>**Subword Tokenization**: Words can be broken down into smaller units or subwords.</li><li>. Example: In BERT, ‘ChatGPT’ might be broken down into [‘Chat’, ‘##G’, ‘##PT’]</li><li>**Character-based Tokenization**: Each character is a token.</li><li>. Example: ‘Chat’ becomes [‘C’, ‘h’, ‘a’, ‘t’]</li></ul><p>## Tokens in Transformer Models</p><p>### BERT (Bidirectional Encoder Representations from Transformers)</p><p>BERT typically uses WordPiece tokenization. In this approach, common words or subwords are preserved, but less common words are broken down into subwords or individual characters. For example, the sentence “ChatGPT is great!” could be tokenized into tokens like `[‘[CLS]’, ‘Chat’, ‘##G’, ‘##PT’, ‘is’, ‘great’, ‘!’, ‘[SEP]’]`.</p><p>### T5 (Text-To-Text Transfer Transformer)</p><p>T5 uses a variant of Byte Pair Encoding (BPE) for its tokenization. It aims to convert all NLP problems into a text-to-text format. The tokenization could look like `[‘Chat’, ‘G’, ‘PT’, ‘ is’, ‘ great’, ‘!’]`.</p><p>## Why are Tokens Important?</p><p>### Flexibility</p><p>Tokenization allows LLMs to understand and manipulate language. Subword tokenization allows models to deal with a broad range of words, even those not seen during training.</p><p>### Efficiency</p><p>By breaking down text into smaller units, LLMs can process and analyze data much more efficiently.</p><p>### Contextual Understanding</p><p>Tokens in models like BERT and T5 can capture contextual relationships between words, enabling nuanced language understanding and generation.</p><p>## Conclusion</p><p>Understanding the concept of tokens is crucial for anyone looking to dive deep into the realm of Large Language Models. Tokens serve as the foundational units of data that enable these sophisticated models to read, understand, and generate human-like text. They play an integral role in the flexibility, efficiency, and capabilities of models like BERT and T5.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8aa0db90ef39" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Improving Text Generation Models with TextRL: A Deep Dive]]></title>
            <link>https://medium.com/@fhirfly/improving-text-generation-models-with-textrl-a-deep-dive-e4a18aa6bc6b?source=rss-e9f3874abea------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4a18aa6bc6b</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[hugging-face]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[FHIRFLY]]></dc:creator>
            <pubDate>Sun, 03 Sep 2023 13:46:48 GMT</pubDate>
            <atom:updated>2023-09-03T13:46:48.594Z</atom:updated>
            <content:encoded><![CDATA[<p>Introduction</p><p>In the constantly evolving field of Natural Language Processing (NLP), generating human-like text remains a formidable challenge. While models like GPT-3 and T5 have shown exceptional capabilities, there is still room for improvement. Enter TextRL: a Python library designed to enhance text generation using reinforcement learning. Built upon existing technologies such as Hugging Face’s Transformers, PFRL, and OpenAI GYM, TextRL offers a convenient and customizable way to optimize your text-generation models. In this article, we will explore the core concepts of TextRL and how it can be applied to improve model outputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*Wl63efLK2aq_ENHq3gtsbA@2x.jpeg" /></figure><p>What is TextRL?</p><p>TextRL stands for “Text Reinforcement Learning” and is essentially a framework that facilitates the implementation of reinforcement learning techniques in text generation models. TextRL combines elements of supervised learning from human feedback and reinforcement learning to produce more effective and reliable text generation models.</p><p>Key Features</p><p>•	Ease of Use: TextRL is designed to be user-friendly, enabling easy integration with existing pipelines.</p><p>•	Customizability: The library is highly customizable, allowing developers to define their own reward functions and other parameters.</p><p>•	Compatibility: Built upon popular libraries like Transformers and OpenAI GYM, it seamlessly integrates with state-of-the-art NLP models and reinforcement learning environments.</p><p>Reinforcement Learning Basics</p><p>In reinforcement learning, an agent takes actions within an environment to achieve a goal. The agent receives rewards based on the actions it takes, and it aims to maximize the total reward over time. TextRL sets up such an environment for text generation, where the model (agent) generates text (actions) and receives rewards based on the quality of the generated text.</p><p>How Does TextRL Work?</p><p>Initial Setup</p><p>1.	Environment Initialization: TextRL sets up an environment where the model can operate.</p><p>2.	Model Loading: Users load a pre-trained model (e.g., T5, GPT-2) using the Transformers library.</p><p>3.	Reward Function: A custom reward function evaluates the quality of generated text.</p><p>Training Loop</p><p>1.	Action: The model generates text based on a seed or input.</p><p>2.	Reward Assessment: The custom reward function evaluates this text.</p><p>3.	Model Update: Using reinforcement learning algorithms like Proximal Policy Optimization (PPO), the model is fine-tuned based on the received reward.</p><p>4.	Iteration: This process is repeated iteratively for improved performance.</p><p>Use Case: Fine-tuning T5 for FHIR-Compliant Text</p><p>Consider a T5 model trained to generate text based on the Fast Healthcare Interoperability Resources (FHIR) standard. By setting up a reward function that evaluates FHIR compliance, accuracy, and completeness, you can use TextRL to fine-tune this model to generate high-quality, compliant text.</p><p>Conclusion</p><p>TextRL offers a compelling approach to refine the capabilities of text generation models. Its blend of ease-of-use, customizability, and state-of-the-art compatibility makes it a powerful tool for NLP developers. Whether you’re fine-tuning a chatbot, a medical text generator, or any other text-based model, TextRL provides a robust framework for achieving better model outputs.</p><p>And that’s not just reinforcing words; it’s reinforcing quality.</p><p>And there you have it — an introduction and deep dive into TextRL and its capabilities. Whether you are a seasoned NLP researcher or a budding enthusiast, TextRL is worth exploring to take your models to the next level.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4a18aa6bc6b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RapidFHIR: Transforming Healthcare Data Management with Fine-Tuned FLAN-T5 Models]]></title>
            <link>https://medium.com/@fhirfly/rapidfhir-transforming-healthcare-data-management-with-fine-tuned-flan-t5-models-97d0596a241f?source=rss-e9f3874abea------2</link>
            <guid isPermaLink="false">https://medium.com/p/97d0596a241f</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[fhir]]></category>
            <category><![CDATA[t5]]></category>
            <dc:creator><![CDATA[FHIRFLY]]></dc:creator>
            <pubDate>Fri, 01 Sep 2023 14:59:30 GMT</pubDate>
            <atom:updated>2023-09-01T14:59:30.729Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4NR2ZW8hj0FNBYGFmHq0bQ.jpeg" /></figure><h3>Introduction</h3><p>The healthcare industry is undergoing a digital transformation, and one of the most critical aspects of this change is the standardization of healthcare data. The Fast Healthcare Interoperability Resources (FHIR) standard has emerged as a key player in this space, enabling seamless exchange of healthcare information. However, creating FHIR resources can be a complex and time-consuming task. Enter RapidFHIR (hugglingface: <a href="https://huggingface.co/fhirfly/rapidfhir-procedures/blob/main/README.md">https://huggingface.co/fhirfly/rapidfhir-procedures/blob/main/README.md)</a>, a fine-tuned transformer model based on Google’s FLAN-T5-small, designed to generate FHIR resources from a simple timestamp seed. This article delves into the architecture, capabilities, and applications of RapidFHIR.</p><h3>What is FHIR?</h3><p>Fast Healthcare Interoperability Resources (FHIR) is a standard for exchanging healthcare information electronically. It was developed by Health Level Seven International (HL7) and aims to simplify the implementation and integration of electronic health records (EHR), enabling better patient care and data management.</p><h3>The FLAN-T5-small Model</h3><p>The FLAN-T5-small model is a transformer-based model developed by Google. It’s a variant of the original T5 (Text-To-Text Transfer Transformer) model and is designed for various natural language processing tasks, from text summarization to translation. The model is known for its efficiency and performance, making it an ideal base for fine-tuning specialized applications like RapidFHIR.</p><h3>RapidFHIR: The Architecture</h3><p>RapidFHIR is a fine-tuned version of the FLAN-T5-small model, optimized for generating FHIR resources. The model takes a timestamp as a seed and uses it to generate a range of FHIR resources, such as Patient, Observation, and Encounter records. The fine-tuning process involves training the model on a large dataset of FHIR resources, enabling it to understand the structure and semantics of healthcare data.</p><h3>Key Features</h3><ol><li>Efficiency: RapidFHIR can generate multiple FHIR resources in seconds, significantly reducing the time required for data entry and management.</li><li>Accuracy: The model is trained to adhere strictly to FHIR standards, ensuring that the generated resources are compliant and accurate.</li><li>Flexibility: RapidFHIR can be integrated into existing healthcare systems with minimal effort, thanks to its API-based architecture.</li><li>Scalability: Being based on the FLAN-T5-small model, RapidFHIR is highly scalable and can be adapted to handle larger datasets and more complex tasks.</li></ol><h3>Applications</h3><h3>EHR Integration</h3><p>RapidFHIR can be seamlessly integrated into existing Electronic Health Records systems to automate the generation of FHIR resources, thereby streamlining data management and improving patient care.</p><h3>Data Migration</h3><p>Healthcare providers often need to migrate data between different systems. RapidFHIR can facilitate this process by generating FHIR-compliant resources that can be easily transferred.</p><h3>Research and Analytics</h3><p>Researchers can use RapidFHIR to quickly generate large datasets of synthetic FHIR resources for analysis, reducing the time and effort required for data collection.</p><h3>Conclusion</h3><p>RapidFHIR represents a significant advancement in healthcare data management. By leveraging the power of fine-tuned transformer models, it simplifies and accelerates the generation of FHIR resources. Whether you’re a healthcare provider looking to improve data management or a researcher in need of large datasets, RapidFHIR offers a fast, accurate, and scalable solution.</p><p>As healthcare continues to evolve, tools like RapidFHIR will play an increasingly important role in shaping the future of healthcare data management. With its efficiency, accuracy, and flexibility, RapidFHIR is well-positioned to become an essential tool in the healthcare industry.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97d0596a241f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Drools, Rete Algorithms, and AI: A Deep Dive into Rule-Based Systems and Their Applications in…]]></title>
            <link>https://medium.com/@fhirfly/drools-rete-algorithms-and-ai-a-deep-dive-into-rule-based-systems-and-their-applications-in-f65d51e4fca5?source=rss-e9f3874abea------2</link>
            <guid isPermaLink="false">https://medium.com/p/f65d51e4fca5</guid>
            <category><![CDATA[rete]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[rules]]></category>
            <category><![CDATA[decision-making]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[FHIRFLY]]></dc:creator>
            <pubDate>Thu, 31 Aug 2023 21:45:30 GMT</pubDate>
            <atom:updated>2023-08-31T21:45:30.401Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pYNoLf3TXfvNq8N7-T5rZA.jpeg" /><figcaption>a fire marshall posting fire rules</figcaption></figure><h3>Drools, Rete Algorithms, and AI: A Deep Dive into Rule-Based Systems and Their Applications in Healthcare</h3><h3>Introduction</h3><p>Artificial Intelligence (AI) has permeated various industries, revolutionizing the way we approach problems and make decisions. One of the less glamorous but highly effective forms of AI is rule-based systems, particularly Drools-based rules engines. These systems are designed to make decisions based on a set of predefined rules. They are often used in conjunction with Business Process Model and Notation (BPMN), Decision Model and Notation (DMN), and Case Management Model and Notation (CMMN) standards from the Object Management Group (OMG) to provide comprehensive solutions for complex business problems. In this article, we will explore the technical aspects of Drools, the Rete algorithm that powers it, and its practical applications in healthcare.</p><h3>Drools-Based Rules Engines</h3><p>Drools is a Business Rules Management System (BRMS) that provides a platform for defining and executing business rules. It is written in Java and is an open-source project under the Apache License. Drools uses a forward-chaining inference engine based on the Rete algorithm to evaluate rules and make decisions.</p><h3>Components</h3><ul><li>Knowledge Base: A repository of all the rules, facts, and data that the system uses.</li><li>Working Memory: The current state of facts that are being evaluated.</li><li>Production Memory: The set of compiled rules.</li><li>Agenda: A queue of activated rules waiting to be fired.</li></ul><h3>Rete Algorithm</h3><p>The Rete algorithm, developed by Dr. Charles Forgy in 1974, is a pattern-matching algorithm designed to efficiently evaluate complex rules. The algorithm constructs a network of nodes, where each node represents a condition in a rule. When a fact is inserted or modified, the Rete algorithm traverses this network to identify which rules are activated.</p><h3>Advantages</h3><ul><li>Efficiency: The Rete algorithm minimizes redundant calculations, making it highly efficient for rule evaluation.</li><li>Scalability: The algorithm scales well with the number of rules and facts, making it suitable for large systems.</li></ul><h3>BPMN, DMN, and CMMN from OASIS</h3><h3>BPMN (Business Process Model and Notation)</h3><p>BPMN is a graphical representation for specifying business processes. It provides a standard way to visualize the flow of activities and decisions within an organization.</p><h3>DMN (Decision Model and Notation)</h3><p>DMN is designed to provide a standard notation for decision-making, including the rules that dictate those decisions. Drools can integrate with DMN to provide a comprehensive decision-making system.</p><h3>CMMN (Case Management Model and Notation)</h3><p>CMMN is used for modeling complex, non-linear scenarios that require more flexibility than BPMN provides. It is often used in conjunction with BPMN and DMN to offer a complete solution for business process management.</p><h3>Practical Uses in Healthcare</h3><h3>Clinical Decision Support Systems</h3><p>Drools can be used to build Clinical Decision Support Systems (CDSS) that assist healthcare providers in making informed decisions. For example, a CDSS could evaluate patient data against a set of medical guidelines to recommend a course of treatment.</p><h3>Workflow Automation</h3><p>Using BPMN, healthcare organizations can automate various workflows, such as patient admission, discharge, and billing processes, thereby increasing efficiency and reducing errors.</p><h3>Compliance and Auditing</h3><p>Healthcare organizations are subject to numerous regulations. Drools can be used to automatically ensure that all processes are compliant with laws and guidelines, making the auditing process much more straightforward.</p><h3>Personalized Treatment Plans</h3><p>By integrating patient data and medical research, Drools can help in creating personalized treatment plans, thereby improving patient outcomes.</p><h3>Conclusion</h3><p>Drools-based rules engines, powered by the Rete algorithm, offer a robust and scalable solution for decision-making and process automation. When combined with BPMN, DMN, and CMMN, they provide a comprehensive framework for tackling complex business problems. In healthcare, these technologies have the potential to revolutionize everything from clinical decision support to workflow automation, compliance, and personalized medicine. As AI continues to evolve, the role of rule-based systems like Drools is likely to become even more critical in driving innovation and efficiency across various industries.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f65d51e4fca5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Democratizing Large Language Models (LLMs) Using Petals]]></title>
            <link>https://medium.com/@fhirfly/democratizing-large-language-models-llms-using-petals-2cd8a2df6f6d?source=rss-e9f3874abea------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cd8a2df6f6d</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[democracy]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[llama-2]]></category>
            <category><![CDATA[healthcare]]></category>
            <dc:creator><![CDATA[FHIRFLY]]></dc:creator>
            <pubDate>Wed, 30 Aug 2023 12:15:40 GMT</pubDate>
            <atom:updated>2023-08-30T12:15:40.742Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Siv_96eOsADKf74YwAqYg.jpeg" /></figure><p>In recent years, large language models (LLMs) have transformed the way we interact with technology, enabling capabilities such as chatbots, language translation, and text generation. However, the sheer size and computational requirements of these models have posed challenges for wider access and adoption. Enter <a href="https://github.com/bigscience-workshop/petals">Petals</a>, a groundbreaking initiative that aims to democratize LLMs by making them accessible and usable by a broader audience, including individual developers and researchers. In this article, we will explore how Petals empowers users to harness the power of LLMs like Llama 2 and BLOOM-176B for their tasks.</p><h3>The Power of LLMs and the Access Challenge</h3><p>LLMs, such as GPT-3.5 and BERT, have demonstrated remarkable capabilities in understanding and generating human-like text. These models are typically trained on massive amounts of data and comprise billions of parameters. However, utilizing these models effectively requires significant computational resources, which often limits access to large organizations with access to high-performance hardware.</p><p>Petals aims to bridge this gap by creating a collaborative network where individuals can contribute their GPU resources to host and run parts of these large models. By distributing the computational load across a network of devices, Petals enables even those without access to cutting-edge hardware to leverage the power of LLMs.</p><h3>Introducing Petals and Its Models</h3><p>Petals provides a user-friendly interface for connecting to its distributed network of hosted model layers. This is made possible through the AutoDistributedModelForCausalLM class provided by the Petals library. By simply loading a small part of a model, users can join forces with others to collectively run inference or fine-tuning tasks.</p><pre>from transformers import AutoTokenizer<br>from petals import AutoDistributedModelForCausalLM</pre><pre>model_name = &quot;petals-team/StableBeluga2&quot;</pre><pre>tokenizer = AutoTokenizer.from_pretrained(model_name)<br>model = AutoDistributedModelForCausalLM.from_pretrained(model_name)</pre><pre>inputs = tokenizer(&quot;A cat sat&quot;, return_tensors=&quot;pt&quot;)[&quot;input_ids&quot;]<br>outputs = model.generate(inputs, max_new_tokens=5)<br>print(tokenizer.decode(outputs[0]))  # A cat sat on a mat...</pre><h3>Making GPUs Accessible with Petals</h3><p>Petals operates on a shared GPU model, where users contribute their GPU resources to the network. The process of hosting a part of a model on your GPU is straightforward and varies based on your operating system. Whether you’re using Linux, Windows with Windows Subsystem for Linux (WSL), Docker, or even macOS with Apple M1/M2 GPU, Petals provides installation and setup instructions for each environment.</p><p>For instance, on Linux using Anaconda, you can host a part of the Stable Beluga 2 model with the following commands:</p><pre>conda install pytorch pytorch-cuda=11.7 -c pytorch -c nvidia<br>pip install git+https://github.com/bigscience-workshop/petals<br>python -m petals.cli.run_server petals-team/StableBeluga2</pre><h3>Collaborative Inference and Beyond</h3><p>Petals not only facilitates single-batch inference at impressive speeds but also allows for parallel inference, which significantly enhances the throughput. This collaborative approach ensures that even resource-intensive tasks can be completed efficiently. Moreover, Petals goes beyond traditional LLM APIs, allowing users to employ fine-tuning, sampling methods, custom paths through the model, and even inspect hidden states, all while enjoying the comfort of an API with the flexibility of PyTorch.</p><h3>Democratizing LLMs: A Community Effort</h3><p>Petals operates as a community-driven system, relying on individuals sharing their GPU resources. By contributing your GPU power, you become part of a collaborative effort to democratize LLMs and make their capabilities accessible to a wider audience. As a token of gratitude, once you’ve loaded and hosted a certain number of blocks, your name or link can be displayed on the swarm monitor.</p><h3>Conclusion</h3><p>Petals revolutionizes the accessibility of large language models by creating a network where individuals can collectively host and run parts of these models. By democratizing access to powerful LLMs like Llama 2 and BLOOM-176B, Petals empowers developers, researchers, and enthusiasts to unlock the potential of natural language understanding and generation. This innovative approach brings us one step closer to a future where AI technologies are accessible to all, regardless of hardware limitations. So, why not join the Petals community and be a part of this exciting journey?</p><p><em>Disclaimer: The information provided in this article is based on the README.md from the project’s GitHub repository as of the knowledge cutoff date in September 2021. For the most up-to-date information and instructions, please refer to the project’s official documentation and repository.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cd8a2df6f6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Retrieval-Augmented Generation with OpenAI Chat GPT and FAISS: A Game-Changer for Clinical Research]]></title>
            <link>https://medium.com/@fhirfly/retrieval-augmented-generation-with-openai-chat-gpt-and-faiss-a-game-changer-for-clinical-research-47b6506da8f7?source=rss-e9f3874abea------2</link>
            <guid isPermaLink="false">https://medium.com/p/47b6506da8f7</guid>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[FHIRFLY]]></dc:creator>
            <pubDate>Fri, 25 Aug 2023 15:16:00 GMT</pubDate>
            <atom:updated>2023-08-29T12:57:30.885Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0G1OVz4R4DyE3g0KhPqAw.jpeg" /></figure><h3>Introduction</h3><p>The advent of large language models like GPT-4 has revolutionized many fields, including healthcare and clinical research. However, these models are not perfect; one of the significant challenges they face is “hallucinating” or generating information that is not accurate or even plausible. In clinical research, where the stakes are incredibly high, such hallucinations can be problematic. So how can we harness the power of these models while also ensuring the accuracy of the information they generate? Enter Retrieval-Augmented Generation (RAG) coupled with FAISS.</p><h3>The Challenge: Hallucination in Language Models</h3><p>In machine learning, “hallucination” refers to the generation of statements or predictions that are not supported by the data. For example, if asked to summarize a medical paper, a hallucinating model might include details or conclusions that are not present in the paper. These hallucinations pose a significant risk, especially in fields like clinical research where accuracy is paramount.</p><h3>What is Retrieval-Augmented Generation (RAG)?</h3><p>Retrieval-Augmented Generation (RAG) is a paradigm that combines the best of both worlds: the powerful generative capabilities of models like GPT-4 and the retrieval capabilities of information databases. In a typical RAG setup, the model first retrieves relevant documents or data snippets from a large corpus and then uses that retrieved information to generate a response. This two-step approach significantly reduces the risk of hallucination as the model has a “reality check” against real-world data.</p><h3>How does RAG Work?</h3><ol><li>Retrieval Phase: Given a query (e.g., a clinical question), the model searches a large database to find relevant documents or snippets.</li><li>Generation Phase: The model uses the retrieved information to generate a response, ensuring that the output is grounded in real-world data.</li></ol><h3>FAISS: The Secret Sauce for Efficient Retrieval</h3><p>FAISS (Facebook AI Similarity Search) is an efficient similarity search and clustering library. It plays a crucial role in the retrieval phase of RAG. FAISS enables the model to search through large databases quickly, making the entire process more efficient and accurate.</p><h3>Putting it All Together: A Practical Example</h3><p>Let’s look at a snippet from a <a href="https://github.com/fhirfly/notebooks/blob/main/PICO%20Pubmed%20Plus%20GPT3.5%20Evidence%20Based%20Medicine.ipynb">Jupytr Notebook </a>that demonstrates how RAG and FAISS can be used for clinical research.</p><p>In this example, the clinical question serves as the query for the RAG model. The model would then retrieve relevant medical papers or data snippets using FAISS before generating an evidence-based response. The Notebook constructs a PICO Clinical Query from any free text clincial query. and searches the NCBI database for mesh term in the individual sentence elements. It then queries PubMed for a list of Documents that meet the Meshed terms. The results are then vectorized and searched using FAISS next nearest neighbor search and the top x number of results are returned. The results are used as part of the prompt for Chat GPT to output and Evidenced Based Medicine result.</p><h3>Conclusion</h3><p>Retrieval-Augmented Generation (RAG) combined with FAISS offers a powerful solution for mitigating the risks of hallucination in large language models. By grounding the generative capabilities of models like GPT-4 in real-world data, we can significantly improve the accuracy and reliability of the information generated. This is particularly beneficial in high-stakes fields like clinical research, where every piece of information can have far-reaching implications.</p><p><em>Note: For a complete example, you can find the full notebook on </em><a href="https://github.com/fhirfly/notebooks/blob/main/PICO%20Pubmed%20Plus%20GPT3.5%20Evidence%20Based%20Medicine.ipynb"><em>GitHub</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=47b6506da8f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tuning the Temperature of GPT Models: A Guide to Reducing Hallucinations]]></title>
            <link>https://medium.com/@fhirfly/tuning-the-temperature-of-gpt-models-a-guide-to-reducing-hallucinations-a92af019c534?source=rss-e9f3874abea------2</link>
            <guid isPermaLink="false">https://medium.com/p/a92af019c534</guid>
            <category><![CDATA[hallucinations]]></category>
            <category><![CDATA[temperature]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[FHIRFLY]]></dc:creator>
            <pubDate>Thu, 24 Aug 2023 15:02:51 GMT</pubDate>
            <atom:updated>2023-08-24T15:02:51.600Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dzqgumjPN7Soe7XbzIV7nQ.jpeg" /><figcaption><strong>Create an image of a person adjusting the temperature button of a hallucinating robot.</strong></figcaption></figure><p>The world of AI has seen remarkable advancements, with models like GPT (Generative Pre-trained Transformer) leading the forefront. These models have the power to generate human-like text, making them incredibly versatile for a plethora of applications. However, they are not without their quirks. One such quirk is the model’s propensity for “hallucinations” — instances where the AI produces information that isn’t accurate or makes sense in context.</p><p>In this article, we’ll explore how to adjust the “temperature” setting of GPT models to minimize these hallucinations, ensuring more accurate and consistent outputs.</p><h4>Understanding Temperature in GPT Models</h4><p>In the realm of GPT models, “temperature” doesn’t refer to heat but to the degree of randomness in the model’s output. Here’s a quick breakdown:</p><ul><li>Temperature = 1.0: This is the default setting where outputs are based on the model’s learned probabilities. It strikes a balance between randomness and determinism.</li><li>Temperature &gt; 1.0: Outputs become more random. This might introduce creativity but can also lead to more hallucinations.</li><li>Temperature &lt; 1.0: Outputs are more deterministic. The model tends to choose the most probable word or token, making outputs more consistent but potentially less diverse.</li></ul><h4>Reducing Hallucinations by Adjusting Temperature</h4><p>Hallucinations can be problematic, especially in scenarios where accuracy and reliability are paramount. Here’s how to adjust the temperature to reduce such occurrences:</p><ol><li>Start with the Default: Before making adjustments, run your task with the default temperature (1.0) to gauge the baseline performance.</li><li>Decrease Incrementally: Begin by slightly decreasing the temperature (e.g., to 0.9 or 0.8). This will make the model’s outputs more deterministic.</li><li>Evaluate and Iterate: After each adjustment, evaluate the results. Are there fewer hallucinations? Is the output too repetitive or lacking in diversity?</li><li>Find the Sweet Spot: The goal is to find a temperature setting where hallucinations are minimized without compromising the richness of the output. This might require multiple iterations.</li></ol><h4>Additional Tips</h4><ul><li>Training Data Matters: Remember that the quality of the model’s training data plays a role in its performance. If the model has been trained on diverse and high-quality data, it’s less likely to produce hallucinations, to begin with.</li><li>Post-Processing: Consider implementing post-processing steps to further filter or refine the model’s outputs. For instance, you can use rule-based systems to check for certain inaccuracies.</li><li>Feedback Loop: Implement a feedback mechanism. If the model produces an output that’s flagged as a hallucination, use this feedback to further fine-tune the temperature or other settings.</li></ul><h4>Conclusion</h4><p>GPT models, with their incredible generative capabilities, have revolutionized the AI landscape. However, like any tool, they require fine-tuning for optimal performance. Adjusting the temperature is a key method to minimize hallucinations and ensure that the outputs are both accurate and meaningful. With careful calibration and continuous evaluation, you can harness the full power of GPT models while minimizing their quirks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a92af019c534" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Fine-tuning for GPT-3.5]]></title>
            <link>https://medium.com/@fhirfly/fine-tuning-for-gpt-3-5-d9567646792c?source=rss-e9f3874abea------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9567646792c</guid>
            <category><![CDATA[fine-tuning]]></category>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[FHIRFLY]]></dc:creator>
            <pubDate>Tue, 22 Aug 2023 23:17:27 GMT</pubDate>
            <atom:updated>2023-08-22T23:17:27.838Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vrAs9imsR4eY7V8z-rN4Uw.jpeg" /></figure><p>Fine-tuning for GPT-3.5 Turbo is <a href="https://openai.com/blog/gpt-3-5-turbo-fine-tuning-and-api-updates">now available</a>, with fine-tuning for GPT-4 coming this fall. This update gives developers the ability to customize models that perform better for their use cases and run these custom models at scale. Early tests have shown a fine-tuned version of GPT-3.5 Turbo can match, or even outperform, base GPT-4-level capabilities on certain narrow tasks. As with all our APIs, data sent in and out of the fine-tuning API is owned by the customer and is <a href="https://openai.com/api-data-privacy">not used by OpenAI</a>, or any other organization, to train other models.</p><h3>Fine-tuning use cases</h3><p>Since the release of GPT-3.5 Turbo, developers and businesses have asked for the ability to customize the model to create unique and differentiated experiences for their users. With this launch, developers can now run supervised fine-tuning to make this model perform better for their use cases.</p><p>In our private beta, fine-tuning customers have been able to meaningfully improve model performance across common use cases, such as:</p><ul><li><strong>Improved steerability</strong>: Fine-tuning allows businesses to make the model follow instructions better, such as making outputs terse or always responding in a given language. For instance, developers can use fine-tuning to ensure that the model always responds in German when prompted to use that language.</li><li><strong>Reliable output formatting:</strong> Fine-tuning improves the model’s ability to consistently format responses — a crucial aspect for applications demanding a specific response format, such as code completion or composing API calls. A developer can use fine-tuning to more reliably convert user prompts into high-quality JSON snippets that can be used with their own systems.</li><li><strong>Custom tone:</strong> Fine-tuning is a great way to hone the qualitative feel of the model output, such as its tone, so it better fits the voice of businesses’ brands. A business with a recognizable brand voice can use fine-tuning for the model to be more consistent with their tone.</li></ul><p>In addition to increased performance, fine-tuning also enables businesses to <strong>shorten their prompts </strong>while ensuring similar performance. Fine-tuning with GPT-3.5-Turbo can also handle 4k tokens — double our previous fine-tuned models. Early testers have reduced prompt size by up to 90% by fine-tuning instructions into the model itself, speeding up each API call and cutting costs.</p><p>Fine-tuning is most powerful when combined with <a href="https://platform.openai.com/docs/guides/gpt-best-practices">other techniques</a> such as prompt engineering, information retrieval, and function calling. Check out the <a href="https://platform.openai.com/docs/guides/fine-tuning">fine-tuning guide</a> to learn more. Support for fine-tuning with function calling and gpt-3.5-turbo-16k will be coming later this fall.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9567646792c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Democratization of AI through Open Source Large Language Models like Llama 2]]></title>
            <link>https://medium.com/@fhirfly/democratization-of-ai-through-open-source-large-language-models-like-llama-2-73dfa0bc5c3f?source=rss-e9f3874abea------2</link>
            <guid isPermaLink="false">https://medium.com/p/73dfa0bc5c3f</guid>
            <category><![CDATA[llama-2]]></category>
            <category><![CDATA[healthcare]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[democratization]]></category>
            <dc:creator><![CDATA[FHIRFLY]]></dc:creator>
            <pubDate>Wed, 02 Aug 2023 01:07:54 GMT</pubDate>
            <atom:updated>2023-08-02T01:07:54.424Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><p>Artificial Intelligence (AI) is a technology that has the potential to revolutionize every facet of our lives. However, a key concern is the concentration of this powerful technology in the hands of a few, creating a power imbalance and limiting diversity in application. To bridge this divide, AI democratization — the process of making AI technology accessible to everyone regardless of their technical expertise or financial resources — has gained significant traction in recent years. One of the key aspects of AI democratization is the use of open-source Large Language Models (LLMs), like Llama 2, which allow a broader range of users to leverage AI technology’s benefits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jxKZM0YB11A0LZwHx-B0Bg.jpeg" /></figure><p><strong>Open-source AI and Democratization</strong></p><p>Open-source AI is a driving force in democratizing AI as it allows a broad user base to access, modify, and use AI technologies without proprietary constraints. Open source models, like Llama 2, a notable example in the field of large language models (LLMs), have become invaluable tools for developers, businesses, and researchers globally. These models are readily available for usage, providing a stepping stone for individuals and organizations to leverage AI in their operations.</p><p><strong>Benefits of Democratizing AI with LLMs</strong></p><ol><li>Fostering Innovation: Open-source LLMs provide a platform for budding developers, data scientists, and researchers to innovate and experiment with AI without heavy investments. As a result, they foster creativity and expedite the development of novel applications in diverse fields such as healthcare, education, finance, and more.</li><li>Bridging the Skill Gap: By making complex AI technologies like LLMs more accessible, we can bridge the digital divide and the skill gap. Non-technical users can leverage these technologies to gain insights, automate processes, and solve problems without the need for deep programming knowledge or AI expertise.</li><li>Enhancing Transparency: Unlike proprietary AI systems, open-source models like Llama 2 are transparent, with their algorithms and working mechanisms available for public scrutiny. This transparency promotes trust in AI systems and allows developers and researchers to identify and rectify biases, flaws, or vulnerabilities.</li><li>Encouraging Collaboration: Open-source LLMs facilitate collaboration among developers, researchers, and organizations across the globe. This collaborative approach accelerates knowledge sharing and fuels technological advancements in AI.</li><li>Promoting Equity: Democratization of AI via open-source LLMs promotes equity by allowing anyone, irrespective of their geographical location, socio-economic status, or technical skills, to access and utilize AI technologies. This reduces the digital divide and fosters inclusivity in the technology realm.</li></ol><p><strong>The Role of Llama 2 in AI Democratization</strong></p><p>Llama 2, a Large Language Model, stands as a prominent example of AI democratization. The model, which leverages advanced AI algorithms to understand and generate human language, is open-source, allowing a diverse user base to use it freely. This allows everyone from startups to established corporations, from students to professional researchers, to benefit from the cutting-edge capabilities that Llama 2 offers.</p><p>By providing such a powerful tool free of cost, Llama 2 allows users to explore and apply AI in novel ways. Its applications range from creating conversational AI and content generation to aiding research in linguistics and developing intelligent virtual assistants.</p><p><strong>Conclusion</strong></p><p>AI democratization through open-source LLMs like Llama 2 holds immense potential in shaping a more equitable, innovative, and inclusive digital future. It encourages participation from all corners of society, fosters innovation, and provides an opportunity for all to reap the benefits of AI. By doing so, it ensures that the power of AI is not just confined to a privileged few but is distributed and utilized for the collective good.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73dfa0bc5c3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>