SlideShare a Scribd company logo
LLM Pair programming
Chakrit Phain
R&D Softnix Technology Co.,Ltd,
Scenario 1:Improve existing code
prompt_template = """
I don't think this code is the best way to do it
in Python, can you help me?
{question}
Please explain, in detail, what you did to
improve it.
"""
Scenario 1:Improve existing code
question = """
def func_x(array)
for i in range(len(array)):
print(array[i])
""”
prompt = prompt_template.format(question=question)
generate_text(prompt)
Scenario 1:Improve existing code
I improved the code by using the `*` operator to unpack
the array into individual arguments for the `print()`
function. This is more concise and efficient than using
a `for` loop.
Scenario 1:Improve existing code
prompt_template = """
I don't think this code is the best way to do it
in Python, can you help me?
{question}
Please explore multiple ways of solving the
problem,
and tell me which is the most Pythonic"""
Scenario 1:Improve existing code
Scenario 2: Simplify code
Can you please simplify this code for a linked list in
Python?
{question}
Explain in detail what you did to modify it, and why.
- Ask the LLM to perform a code review.
- Note that adding/removing newline characters may affect the LLM
completion that gets output by the LLM.
Scenario 2: Simplify code
List1.headval.dataval =>Mon
List1.headval.nextval.dataval=> Tue
List1.headval.nextval.nextval.datval= Wed
Scenario 2: Simplify code
List1.headval.dataval =>Mon
List1.headval.nextval.dataval=> Tue
List1.headval.nextval.nextval.datval= Wed
Scenario 2: Simplify code
Can you please simplify this code for a linked list in
Python?
You are an expert in Pythonic code.
{question}
Please comment each line in detail,
and explain in detail what you did to modify it, and why.
Scenario 2: Simplify code
Scenario 3: Write test cases
- It may help to specify that you want the LLM to output "in code" to
encourage it to write unit tests instead of just returning test cases in English.
Can you please create test cases in code for this Python code?
{question}
Explain in detail what these test cases are designed to achieve.
Scenario 3: Write test cases
- It may help to specify that you want the LLM to output "in code" to
encourage it to write unit tests instead of just returning test cases in English.
Scenario 3: Write test cases
Scenario 4: Make code more efficient
- Improve runtime by potentiallyavoidinginefficient methods (such as ones that use
recursion when not needed).
Can you please make this code more efficient?
{question}
Explain in detail what you changed and why.
Scenario 4: Make code more efficient
Scenario 4: Make code more efficient
Scenario 5: Debug your code
prompt_template = """
Can you please help me to debug this code?
{question}
Explain in detail what you found and why it was a bug.
"""
Scenario 5: Debug your code
Scenario 5: Debug your code

More Related Content

Similar to LLM_PairProgramming.pdf

Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingHamad Odhabi
 
Question 1 1 pts Skip to question text.As part of a bank account.docx
Question 1 1 pts Skip to question text.As part of a bank account.docxQuestion 1 1 pts Skip to question text.As part of a bank account.docx
Question 1 1 pts Skip to question text.As part of a bank account.docxamrit47
 
Clean code: understanding Boundaries and Unit Tests
Clean code: understanding Boundaries and Unit TestsClean code: understanding Boundaries and Unit Tests
Clean code: understanding Boundaries and Unit Testsradin reth
 
Devry CIS 355A Full Course Latest
Devry CIS 355A Full Course LatestDevry CIS 355A Full Course Latest
Devry CIS 355A Full Course LatestAtifkhilji
 
Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine LearningStudent
 
Objectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxObjectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxdunhamadell
 
Understand and Harness the Capabilities of Intel® Xeon Phi™ Processors
Understand and Harness the Capabilities of Intel® Xeon Phi™ ProcessorsUnderstand and Harness the Capabilities of Intel® Xeon Phi™ Processors
Understand and Harness the Capabilities of Intel® Xeon Phi™ ProcessorsIntel® Software
 
The Ultimate Question of Programming, Refactoring, and Everything
The Ultimate Question of Programming, Refactoring, and EverythingThe Ultimate Question of Programming, Refactoring, and Everything
The Ultimate Question of Programming, Refactoring, and EverythingAndrey Karpov
 
The Ultimate Question of Programming, Refactoring, and Everything
The Ultimate Question of Programming, Refactoring, and EverythingThe Ultimate Question of Programming, Refactoring, and Everything
The Ultimate Question of Programming, Refactoring, and EverythingPVS-Studio
 
CODE TUNINGtertertertrtryryryryrtytrytrtry
CODE TUNINGtertertertrtryryryryrtytrytrtryCODE TUNINGtertertertrtryryryryrtytrytrtry
CODE TUNINGtertertertrtryryryryrtytrytrtrykapib57390
 
Important notes· NOTE it is usually fine and often encouraged i.docx
Important notes· NOTE it is usually fine and often encouraged i.docxImportant notes· NOTE it is usually fine and often encouraged i.docx
Important notes· NOTE it is usually fine and often encouraged i.docxwilcockiris
 
OverviewAssignment 1 Hypothetical Machine SimulatorCSci 43.docx
OverviewAssignment 1  Hypothetical Machine SimulatorCSci 43.docxOverviewAssignment 1  Hypothetical Machine SimulatorCSci 43.docx
OverviewAssignment 1 Hypothetical Machine SimulatorCSci 43.docxhoney690131
 
Your Own Metric System
Your Own Metric SystemYour Own Metric System
Your Own Metric SystemErin Dees
 
JAVASCRIPT PERFORMANCE PATTERN - A Presentation
JAVASCRIPT PERFORMANCE PATTERN - A PresentationJAVASCRIPT PERFORMANCE PATTERN - A Presentation
JAVASCRIPT PERFORMANCE PATTERN - A PresentationHabilelabs
 
Gsp 215 Believe Possibilities / snaptutorial.com
Gsp 215  Believe Possibilities / snaptutorial.comGsp 215  Believe Possibilities / snaptutorial.com
Gsp 215 Believe Possibilities / snaptutorial.comStokesCope20
 
Assignment 1 Hypothetical Machine SimulatorCSci 430 Int.docx
Assignment 1  Hypothetical Machine SimulatorCSci 430 Int.docxAssignment 1  Hypothetical Machine SimulatorCSci 430 Int.docx
Assignment 1 Hypothetical Machine SimulatorCSci 430 Int.docxjane3dyson92312
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newnikig6806
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newmybrands2
 
cs348-06-lab3.doc
cs348-06-lab3.doccs348-06-lab3.doc
cs348-06-lab3.docbutest
 

Similar to LLM_PairProgramming.pdf (20)

RubyTesting
RubyTestingRubyTesting
RubyTesting
 
Cis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programmingCis 1403 lab1- the process of programming
Cis 1403 lab1- the process of programming
 
Question 1 1 pts Skip to question text.As part of a bank account.docx
Question 1 1 pts Skip to question text.As part of a bank account.docxQuestion 1 1 pts Skip to question text.As part of a bank account.docx
Question 1 1 pts Skip to question text.As part of a bank account.docx
 
Clean code: understanding Boundaries and Unit Tests
Clean code: understanding Boundaries and Unit TestsClean code: understanding Boundaries and Unit Tests
Clean code: understanding Boundaries and Unit Tests
 
Devry CIS 355A Full Course Latest
Devry CIS 355A Full Course LatestDevry CIS 355A Full Course Latest
Devry CIS 355A Full Course Latest
 
Python for Machine Learning
Python for Machine LearningPython for Machine Learning
Python for Machine Learning
 
Objectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docxObjectives Assignment 09 Applications of Stacks COS.docx
Objectives Assignment 09 Applications of Stacks COS.docx
 
Understand and Harness the Capabilities of Intel® Xeon Phi™ Processors
Understand and Harness the Capabilities of Intel® Xeon Phi™ ProcessorsUnderstand and Harness the Capabilities of Intel® Xeon Phi™ Processors
Understand and Harness the Capabilities of Intel® Xeon Phi™ Processors
 
The Ultimate Question of Programming, Refactoring, and Everything
The Ultimate Question of Programming, Refactoring, and EverythingThe Ultimate Question of Programming, Refactoring, and Everything
The Ultimate Question of Programming, Refactoring, and Everything
 
The Ultimate Question of Programming, Refactoring, and Everything
The Ultimate Question of Programming, Refactoring, and EverythingThe Ultimate Question of Programming, Refactoring, and Everything
The Ultimate Question of Programming, Refactoring, and Everything
 
CODE TUNINGtertertertrtryryryryrtytrytrtry
CODE TUNINGtertertertrtryryryryrtytrytrtryCODE TUNINGtertertertrtryryryryrtytrytrtry
CODE TUNINGtertertertrtryryryryrtytrytrtry
 
Important notes· NOTE it is usually fine and often encouraged i.docx
Important notes· NOTE it is usually fine and often encouraged i.docxImportant notes· NOTE it is usually fine and often encouraged i.docx
Important notes· NOTE it is usually fine and often encouraged i.docx
 
OverviewAssignment 1 Hypothetical Machine SimulatorCSci 43.docx
OverviewAssignment 1  Hypothetical Machine SimulatorCSci 43.docxOverviewAssignment 1  Hypothetical Machine SimulatorCSci 43.docx
OverviewAssignment 1 Hypothetical Machine SimulatorCSci 43.docx
 
Your Own Metric System
Your Own Metric SystemYour Own Metric System
Your Own Metric System
 
JAVASCRIPT PERFORMANCE PATTERN - A Presentation
JAVASCRIPT PERFORMANCE PATTERN - A PresentationJAVASCRIPT PERFORMANCE PATTERN - A Presentation
JAVASCRIPT PERFORMANCE PATTERN - A Presentation
 
Gsp 215 Believe Possibilities / snaptutorial.com
Gsp 215  Believe Possibilities / snaptutorial.comGsp 215  Believe Possibilities / snaptutorial.com
Gsp 215 Believe Possibilities / snaptutorial.com
 
Assignment 1 Hypothetical Machine SimulatorCSci 430 Int.docx
Assignment 1  Hypothetical Machine SimulatorCSci 430 Int.docxAssignment 1  Hypothetical Machine SimulatorCSci 430 Int.docx
Assignment 1 Hypothetical Machine SimulatorCSci 430 Int.docx
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
 
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts newDevry ecet 370 week 3 ilab the stack and the queue ad ts new
Devry ecet 370 week 3 ilab the stack and the queue ad ts new
 
cs348-06-lab3.doc
cs348-06-lab3.doccs348-06-lab3.doc
cs348-06-lab3.doc
 

More from Chakrit Phain

Web scraping with php
Web scraping with phpWeb scraping with php
Web scraping with phpChakrit Phain
 
ChatGPT_Prompts.pptx
ChatGPT_Prompts.pptxChatGPT_Prompts.pptx
ChatGPT_Prompts.pptxChakrit Phain
 
Web Scraping with Python
Web Scraping with PythonWeb Scraping with Python
Web Scraping with PythonChakrit Phain
 
เปรียบเทียบ RPA Opensource
เปรียบเทียบ  RPA Opensourceเปรียบเทียบ  RPA Opensource
เปรียบเทียบ RPA OpensourceChakrit Phain
 
PHP Bandwidth Shaping script
PHP Bandwidth Shaping scriptPHP Bandwidth Shaping script
PHP Bandwidth Shaping scriptChakrit Phain
 
PHP Explode & Preg_split Test
PHP Explode & Preg_split TestPHP Explode & Preg_split Test
PHP Explode & Preg_split TestChakrit Phain
 
Types of Big Data Analytics
Types of Big Data AnalyticsTypes of Big Data Analytics
Types of Big Data AnalyticsChakrit Phain
 
Machine Learning Algorithm & Anomaly detection 2021
Machine Learning Algorithm & Anomaly detection 2021Machine Learning Algorithm & Anomaly detection 2021
Machine Learning Algorithm & Anomaly detection 2021Chakrit Phain
 
Text classification With Rapid Miner
Text classification With Rapid MinerText classification With Rapid Miner
Text classification With Rapid MinerChakrit Phain
 
Ai optimization Example
Ai optimization ExampleAi optimization Example
Ai optimization ExampleChakrit Phain
 
Anomaly Detection Technique
Anomaly Detection TechniqueAnomaly Detection Technique
Anomaly Detection TechniqueChakrit Phain
 
Softnix Anomaly Detection Methods
Softnix Anomaly Detection MethodsSoftnix Anomaly Detection Methods
Softnix Anomaly Detection MethodsChakrit Phain
 
Neo4j Graph Database และการประยุกตร์ใช้
Neo4j Graph Database และการประยุกตร์ใช้Neo4j Graph Database และการประยุกตร์ใช้
Neo4j Graph Database และการประยุกตร์ใช้Chakrit Phain
 
Softnix how ml_work_0.1draft
Softnix how ml_work_0.1draftSoftnix how ml_work_0.1draft
Softnix how ml_work_0.1draftChakrit Phain
 

More from Chakrit Phain (20)

Web scraping with php
Web scraping with phpWeb scraping with php
Web scraping with php
 
ChatGPT_Prompts.pptx
ChatGPT_Prompts.pptxChatGPT_Prompts.pptx
ChatGPT_Prompts.pptx
 
Sentence-BERT
Sentence-BERTSentence-BERT
Sentence-BERT
 
AI_ML_Softnix.pdf
AI_ML_Softnix.pdfAI_ML_Softnix.pdf
AI_ML_Softnix.pdf
 
Web Scraping with Python
Web Scraping with PythonWeb Scraping with Python
Web Scraping with Python
 
เปรียบเทียบ RPA Opensource
เปรียบเทียบ  RPA Opensourceเปรียบเทียบ  RPA Opensource
เปรียบเทียบ RPA Opensource
 
PHP Bandwidth Shaping script
PHP Bandwidth Shaping scriptPHP Bandwidth Shaping script
PHP Bandwidth Shaping script
 
PHP Explode & Preg_split Test
PHP Explode & Preg_split TestPHP Explode & Preg_split Test
PHP Explode & Preg_split Test
 
Types of Big Data Analytics
Types of Big Data AnalyticsTypes of Big Data Analytics
Types of Big Data Analytics
 
Genetic Algorithm
Genetic AlgorithmGenetic Algorithm
Genetic Algorithm
 
Machine Learning Algorithm & Anomaly detection 2021
Machine Learning Algorithm & Anomaly detection 2021Machine Learning Algorithm & Anomaly detection 2021
Machine Learning Algorithm & Anomaly detection 2021
 
Text classification With Rapid Miner
Text classification With Rapid MinerText classification With Rapid Miner
Text classification With Rapid Miner
 
Ai optimization Example
Ai optimization ExampleAi optimization Example
Ai optimization Example
 
Zabbix aws
Zabbix awsZabbix aws
Zabbix aws
 
Anomaly Detection Technique
Anomaly Detection TechniqueAnomaly Detection Technique
Anomaly Detection Technique
 
Softnix Anomaly Detection Methods
Softnix Anomaly Detection MethodsSoftnix Anomaly Detection Methods
Softnix Anomaly Detection Methods
 
Neo4j Graph Database และการประยุกตร์ใช้
Neo4j Graph Database และการประยุกตร์ใช้Neo4j Graph Database และการประยุกตร์ใช้
Neo4j Graph Database และการประยุกตร์ใช้
 
Softnix how ml_work_0.1draft
Softnix how ml_work_0.1draftSoftnix how ml_work_0.1draft
Softnix how ml_work_0.1draft
 
Shell Shock
Shell ShockShell Shock
Shell Shock
 
Neo4j introduction
Neo4j introductionNeo4j introduction
Neo4j introduction
 

Recently uploaded

Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...Product School
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsExpeed Software
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesThousandEyes
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Alison B. Lowndes
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaRTTS
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform EngineeringJemma Hussein Allen
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutesconfluent
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Product School
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...Product School
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Thierry Lestable
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
 

Recently uploaded (20)

Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 

LLM_PairProgramming.pdf

  • 1. LLM Pair programming Chakrit Phain R&D Softnix Technology Co.,Ltd,
  • 2. Scenario 1:Improve existing code prompt_template = """ I don't think this code is the best way to do it in Python, can you help me? {question} Please explain, in detail, what you did to improve it. """
  • 3. Scenario 1:Improve existing code question = """ def func_x(array) for i in range(len(array)): print(array[i]) ""” prompt = prompt_template.format(question=question) generate_text(prompt)
  • 4. Scenario 1:Improve existing code I improved the code by using the `*` operator to unpack the array into individual arguments for the `print()` function. This is more concise and efficient than using a `for` loop.
  • 5. Scenario 1:Improve existing code prompt_template = """ I don't think this code is the best way to do it in Python, can you help me? {question} Please explore multiple ways of solving the problem, and tell me which is the most Pythonic"""
  • 7. Scenario 2: Simplify code Can you please simplify this code for a linked list in Python? {question} Explain in detail what you did to modify it, and why. - Ask the LLM to perform a code review. - Note that adding/removing newline characters may affect the LLM completion that gets output by the LLM.
  • 8. Scenario 2: Simplify code List1.headval.dataval =>Mon List1.headval.nextval.dataval=> Tue List1.headval.nextval.nextval.datval= Wed
  • 9. Scenario 2: Simplify code List1.headval.dataval =>Mon List1.headval.nextval.dataval=> Tue List1.headval.nextval.nextval.datval= Wed
  • 10. Scenario 2: Simplify code Can you please simplify this code for a linked list in Python? You are an expert in Pythonic code. {question} Please comment each line in detail, and explain in detail what you did to modify it, and why.
  • 12. Scenario 3: Write test cases - It may help to specify that you want the LLM to output "in code" to encourage it to write unit tests instead of just returning test cases in English. Can you please create test cases in code for this Python code? {question} Explain in detail what these test cases are designed to achieve.
  • 13. Scenario 3: Write test cases - It may help to specify that you want the LLM to output "in code" to encourage it to write unit tests instead of just returning test cases in English.
  • 14. Scenario 3: Write test cases
  • 15. Scenario 4: Make code more efficient - Improve runtime by potentiallyavoidinginefficient methods (such as ones that use recursion when not needed). Can you please make this code more efficient? {question} Explain in detail what you changed and why.
  • 16. Scenario 4: Make code more efficient
  • 17. Scenario 4: Make code more efficient
  • 18. Scenario 5: Debug your code prompt_template = """ Can you please help me to debug this code? {question} Explain in detail what you found and why it was a bug. """
  • 19. Scenario 5: Debug your code
  • 20. Scenario 5: Debug your code