DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Implementing Ethical AI: Practical Techniques for Aligning AI Agents With Human Values
  • Foundational Building Blocks for AI Applications
  • Application Task Driven: LLM Evaluation Metrics in Detail
  • Architecting High-Performance Supercomputers for Tomorrow's Challenges

Trending

  • Endpoint Security Controls: Designing a Secure Endpoint Architecture, Part 2
  • Designing a Java Connector for Software Integrations
  • Unit Testing Large Codebases: Principles, Practices, and C++ Examples
  • Modern Test Automation With AI (LLM) and Playwright MCP
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Docs to Codes Generation Using LLMs

Docs to Codes Generation Using LLMs

Large Language Models (LLMs) significantly streamline the translation of detailed doctors' notes into precise medical codes, enhancing efficiency and accuracy.

By 
Tushar Chugh user avatar
Tushar Chugh
·
Rolly Seth user avatar
Rolly Seth
·
Prerak Garg user avatar
Prerak Garg
·
SAMBANDH BHUSAN DHAL user avatar
SAMBANDH BHUSAN DHAL
·
Nov. 09, 23 · Review
Likes (1)
Comment
Save
Tweet
Share
1.8K Views

Join the DZone community and get the full member experience.

Join For Free

Generating code from doctors' notes can be a complex task as it requires a deep understanding of medical terminology and the ability to translate that information into the specific codes used in medical billing and reimbursement. The Large Language Models (LLMs) with the encoded world knowledge have a great potential to make this task more efficient and accurate.    

Evolution of Machine Learning to LLMs

The field of machine learning has undergone a significant transformation in the past decade. Previously, generating codes from doctors' notes using machine learning was a slow, difficult, and imprecise process. It involved collecting and preprocessing relevant data, crafting features by hand, selecting the right model, tuning the model through adjusting hyperparameters, and creating the infrastructure to deploy the model. These tasks were tedious and expensive, but the end result was often a model with suboptimal performance.

Figure 1: Traditional machine learning process

Figure 1: Traditional machine learning process

However, with the advent of deep learning, the process became easier and more accurate. Deep networks were able to encode knowledge through their embeddings. The issue with deep models was their dependence on a significant amount of data required for training.

Now, the evolution of large language models like GPT has made language-related tasks, such as in the healthcare sector, much simpler. These models, with O(100B) parameters, encode a vast amount of knowledge from diverse domains and sources such as healthcare, software programming, books, blogs, scientific papers, and social media. Learning from a massive amount of data allows them to learn rich representations of language from data and generalize to new tasks. For a wide variety of simple tasks, the models can be used with zero or few shots learning, and for more complex tasks, these models can be fine-tuned with a small amount of data.

LLMs and Prompt Engineering

One aim in the field of machine learning has been to develop algorithms that can learn in a manner similar to humans. These algorithms should comprehend simple sets of tasks when given instructions and examples. In the realm of Large Language Models, these instructions and examples are called prompts.

Zero-Shot Learning

The prompts could be straightforward requests from the users, such as:

  1. Summarize the text
  2. Paraphrase the text
  3. Why is the sky blue?
  4. Write a code to check if the string is palindrome.

These models can answer these questions without the need for further examples, a process known as zero-shot learning.

Few Shots Learning and Chain-Of-Thought Prompting

Some tasks necessitate more detailed instructions, similar to those a human would receive. An illustration of this type of prompt would be:

 
Task

```

Input: Healthcare Industry Output: ey

Input: Machine Learning Output: eg

Input: San Francisco Output:

```


Here, the task is to figure out a pattern from the input-output pairs and predict that the output is “no.” The pattern is to return the last letter of each work. 

Below is the output from ChatGPT where it got it wrong:

Below is the output from ChatGPT where it got it wrong

Giving more detailed instructions to the model generated the correct answer. This explanation given to the prompts to yield required answers is called chain-of-thought prompting.

Giving more detailed instructions to the model generated the correct answer. This explanation given to the prompts to yield required answers is called chain-of-thought prompting.

This process of creating, designing, and fine-tuning prompts is called prompt engineering. The goal of prompt engineering is to provide input to the language model in a specific way so that it generates output that is relevant, coherent, and consistent with the intended meaning. This involves writing effective and clear prompts that can guide the language model to generate high-quality output that meets the needs of a particular use case, such as generating answers to questions, writing stories, composing poems, or translating text. The process of prompt engineering also involves testing and evaluating the performance of the language model with different prompts, making adjustments as necessary to improve its output.

In the context of generating codes from physician's notes, prompt engineering would involve addressing abbreviations and comprehending the differences and subtleties of diseases, symptoms, and medication prescriptions.

Development Steps

The process of utilizing large language models (LLMs) to produce medical codes from physicians' notes involves the following steps:

  1. Acquire the data: Obtain the data and perform manual pre-processing for initial experimentation.
  2. Establish the metrics: Determine the metrics for evaluating system performance, such as precision and recall of predicted responses and response time latency.
  3. Select LLM: Explore different LLMs and their APIs. Possible choices: GPT, BARD.
  4. Set up workspace: Setting up a workspace for prompt engineering.
  5. Prompt engineering: Engage in prompt engineering by experimenting with chain-of-thought prompting to find the optimal set of prompts.
  6. Establish the benchmark: Establish a benchmark for performance and comparing it to current processes and market solutions.
  7. Generate a dataset: Generate a dataset through LLM inference.
  8. Distillation: Train a student model through the distillation of the teacher model.
  9. Performance benchmark: Benchmark the performance of the student model and identify strengths and weaknesses.
  10. Serving infrastructure: Set up a serving infrastructure for the student model, including necessary adaptors and software systems for integration with existing systems.

Figure 2: High-level training and infra pipeline

Figure 2: High-level training and infra pipeline

Language model Machine learning

Opinions expressed by DZone contributors are their own.

Related

  • Implementing Ethical AI: Practical Techniques for Aligning AI Agents With Human Values
  • Foundational Building Blocks for AI Applications
  • Application Task Driven: LLM Evaluation Metrics in Detail
  • Architecting High-Performance Supercomputers for Tomorrow's Challenges

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!