SlideShare a Scribd company logo
1 of 32
Download to read offline
On Programming Variability with Large
Language Model-based Assistant
Mathieu Acher, José A. Galindo, Jean-Marc Jézéquel
https://inria.hal.science/hal-04153310/
https://github.com/acherm/progvary-withgpt/
1
2
3
Generative programming [Czarnecki2000], Model-driven engineering:
automatically generate variants from a specification written in one or more textual or
graphical domain-specific languages
Accidental and
essential complexity
Variability further
increases this
software complexity:
multiple features, code
variations, and an
exponential number of
possible variants 4
LLM
Hypothesis: Large language models (LLMs) act as a new variability compiler capable
of transforming a high-level specification (“prompt”) into variable code, features,
generators, configurable systems, etc. written in a given technological space.
Motto:
“features as
prompts”
5
https://github.com/acherm/progvary-withgpt/blob/main/conditioncompilation-helloworld/Chat
GPT-Rust_Configurable_Feature_Program.md
6
https://github.com/acherm/progvary-withgpt/blob/main/conditioncom
pilation-helloworld/ChatGPT-Java_program_with_Jinja.md 7
https://github.com/acherm/
progvary-withgpt/blob/main/
conditioncompilation-hellow
orld/ChatGPT-Java_progra
m_with_Jinja.md 8
https://github.com/acherm/progvary-withgpt/blob/main/featuret
oggle-helloworld/ChatGPT-Unleash_JS_Feature_Toggles.md
9
“would it be possible to adapt the
program as a Web application... and
provide a server-side that returns the
output while the client side prints it”
https://github.com/acherm/progvary-withgpt/blob/main/featuret
oggle-helloworld/ChatGPT-Unleash_JS_Feature_Toggles.md
10
Here is a TikZ code:
tikzset{%
something/.pic={
tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}}
useasboundingbox (-1,-1) (1,2);
fill [BlueGrey900] (0,-2)
.. controls ++(180:3) and ++(0:5/4) .. (-2,0)
arc (270:90:1/5)
.. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5);
foreach i in {-1,1}
scoped[shift={(1/2*i,9/4)}, rotate=45*i]{
clip [overlay] (0, 5/9) ellipse [radius=8/9];
clip [overlay] (0,-5/9) ellipse [radius=8/9];
fill [BlueGrey900] ellipse [radius=1];
clip [overlay] (0, 7/9) ellipse [radius=10/11];
clip [overlay] (0,-7/9) ellipse [radius=10/11];
fill [Purple100] ellipse [radius=1];
};
fill [BlueGrey900] ellipse [x radius=3/4, y radius=2];
fill [BlueGrey100] ellipse [x radius=1/3, y radius=1];
fill [BlueGrey900]
(0,15/8) ellipse [x radius=1, y radius=5/6]
(0, 8/6) ellipse [x radius=1/2, y radius=1/2]
{[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]}
{[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]};
fill [BlueGrey500]
(-1/9,11/8) ellipse [x radius=1/5, y radius=1/5]
11
Here is a TikZ code:
tikzset{%
cat/.pic={
tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}}
useasboundingbox (-1,-1) (1,2);
fill [BlueGrey900] (0,-2)
.. controls ++(180:3) and ++(0:5/4) .. (-2,0)
arc (270:90:1/5)
.. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5);
foreach i in {-1,1}
scoped[shift={(1/2*i,9/4)}, rotate=45*i]{
clip [overlay] (0, 5/9) ellipse [radius=8/9];
clip [overlay] (0,-5/9) ellipse [radius=8/9];
fill [BlueGrey900] ellipse [radius=1];
clip [overlay] (0, 7/9) ellipse [radius=10/11];
clip [overlay] (0,-7/9) ellipse [radius=10/11];
fill [Purple100] ellipse [radius=1];
};
fill [BlueGrey900] ellipse [x radius=3/4, y radius=2];
fill [BlueGrey100] ellipse [x radius=1/3, y radius=1];
fill [BlueGrey900]
(0,15/8) ellipse [x radius=1, y radius=5/6]
(0, 8/6) ellipse [x radius=1/2, y radius=1/2]
{[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]}
{[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]};
fill [BlueGrey500]
(-1/9,11/8) ellipse [x radius=1/5, y radius=1/5]
( 1/9,11/8) ellipse [x radius=1/5, y radius=1/5];
fill [Purple100]
(0,12/8) ellipse [x radius=1/10, y radius=1/5]
(0,12/8+1/9) ellipse [x radius=1/5 , y radius=1/10];
foreach i in {-1,1}
scoped[shift={(1/2*i,2)}, rotate=35*i]{
clip [overlay] (0, 1/7) ellipse [radius=2/7];
clip [overlay] (0,-1/7) ellipse [radius=2/7];
fill [Yellow50] ellipse [radius=1];
};
scoped{
clip (-1,-2) rectangle ++(2,1);
fill [BlueGrey900] (0,-2) ellipse [radius=1/2];
fill [Grey100]
(-1/2,-2) ellipse [x radius=1/3, y radius=1/4]
( 1/2,-2) ellipse [x radius=1/3, y radius=1/4];
};
foreach i in {-1,1}
foreach j in {-1,0,1}
fill [Grey100, shift={(0,11/8)}, xscale=i, rotate=j*15,
12
Here is a TikZ code:
tikzset{%
cat/.pic={
tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}}
useasboundingbox (-1,-1) (1,2);
fill [BlueGrey900] (0,-2)
.. controls ++(180:3) and ++(0:5/4) .. (-2,0)
arc (270:90:1/5)
.. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5);
foreach i in {-1,1}
scoped[shift={(1/2*i,9/4)}, rotate=45*i]{
clip [overlay] (0, 5/9) ellipse [radius=8/9];
clip [overlay] (0,-5/9) ellipse [radius=8/9];
fill [BlueGrey900] ellipse [radius=1];
clip [overlay] (0, 7/9) ellipse [radius=10/11];
clip [overlay] (0,-7/9) ellipse [radius=10/11];
fill [Purple100] ellipse [radius=1];
};
fill [BlueGrey900] ellipse [x radius=3/4, y radius=2];
fill [BlueGrey100] ellipse [x radius=1/3, y radius=1];
fill [BlueGrey900]
(0,15/8) ellipse [x radius=1, y radius=5/6]
(0, 8/6) ellipse [x radius=1/2, y radius=1/2]
{[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]}
{[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]};
fill [BlueGrey500]
(-1/9,11/8) ellipse [x radius=1/5, y radius=1/5]
( 1/9,11/8) ellipse [x radius=1/5, y radius=1/5];
fill [Purple100]
(0,12/8) ellipse [x radius=1/10, y radius=1/5]
(0,12/8+1/9) ellipse [x radius=1/5 , y radius=1/10];
foreach i in {-1,1}
scoped[shift={(1/2*i,2)}, rotate=35*i]{
clip [overlay] (0, 1/7) ellipse [radius=2/7];
clip [overlay] (0,-1/7) ellipse [radius=2/7];
fill [Yellow50] ellipse [radius=1];
I’d like to change the color of the cat’s tail
13
Here is a TikZ code:
tikzset{%
cat/.pic={
tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}}
useasboundingbox (-1,-1) (1,2);
fill [BlueGrey900] (0,-2)
.. controls ++(180:3) and ++(0:5/4) .. (-2,0)
arc (270:90:1/5)
.. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5);
foreach i in {-1,1}
scoped[shift={(1/2*i,9/4)}, rotate=45*i]{
clip [overlay] (0, 5/9) ellipse [radius=8/9];
clip [overlay] (0,-5/9) ellipse [radius=8/9];
fill [BlueGrey900] ellipse [radius=1];
clip [overlay] (0, 7/9) ellipse [radius=10/11];
clip [overlay] (0,-7/9) ellipse [radius=10/11];
fill [Purple100] ellipse [radius=1];
};
fill [BlueGrey900] ellipse [x radius=3/4, y radius=2];
fill [BlueGrey100] ellipse [x radius=1/3, y radius=1];
fill [BlueGrey900]
(0,15/8) ellipse [x radius=1, y radius=5/6]
(0, 8/6) ellipse [x radius=1/2, y radius=1/2]
{[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]}
{[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]};
fill [BlueGrey500]
(-1/9,11/8) ellipse [x radius=1/5, y radius=1/5]
( 1/9,11/8) ellipse [x radius=1/5, y radius=1/5];
fill [Purple100]
(0,12/8) ellipse [x radius=1/10, y radius=1/5]
(0,12/8+1/9) ellipse [x radius=1/5 , y radius=1/10];
foreach i in {-1,1}
scoped[shift={(1/2*i,2)}, rotate=35*i]{
clip [overlay] (0, 1/7) ellipse [radius=2/7];
clip [overlay] (0,-1/7) ellipse [radius=2/7];
fill [Yellow50] ellipse [radius=1];
I’d like to change the color of the cat’s tail
added by
ChatGPT!
14
https://github.com/acherm/progvary-withgpt/blob/main/varyTikZ/ChatGPT-Change_eye_color.md
15
https://github.com/acherm/progvary-withgpt/blob/main/varyTikZ/ChatGPT-Change_eye_color.md
16
Replication
17
Here is a TikZ code:
tikzset{%
cat/.pic={
tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}}
useasboundingbox (-1,-1) (1,2);
fill [BlueGrey900] (0,-2)
.. controls ++(180:3) and ++(0:5/4) .. (-2,0)
arc (270:90:1/5)
.. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5);
foreach i in {-1,1}
scoped[shift={(1/2*i,9/4)}, rotate=45*i]{
clip [overlay] (0, 5/9) ellipse [radius=8/9];
clip [overlay] (0,-5/9) ellipse [radius=8/9];
fill [BlueGrey900] ellipse [radius=1];
clip [overlay] (0, 7/9) ellipse [radius=10/11];
clip [overlay] (0,-7/9) ellipse [radius=10/11];
fill [Purple100] ellipse [radius=1];
};
fill [BlueGrey900] ellipse [x radius=3/4, y radius=2];
fill [BlueGrey100] ellipse [x radius=1/3, y radius=1];
fill [BlueGrey900]
(0,15/8) ellipse [x radius=1, y radius=5/6]
(0, 8/6) ellipse [x radius=1/2, y radius=1/2]
{[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]}
{[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]};
fill [BlueGrey500]
(-1/9,11/8) ellipse [x radius=1/5, y radius=1/5]
( 1/9,11/8) ellipse [x radius=1/5, y radius=1/5];
fill [Purple100]
(0,12/8) ellipse [x radius=1/10, y radius=1/5]
(0,12/8+1/9) ellipse [x radius=1/5 , y radius=1/10];
foreach i in {-1,1}
scoped[shift={(1/2*i,2)}, rotate=35*i]{
clip [overlay] (0, 1/7) ellipse [radius=2/7];
clip [overlay] (0,-1/7) ellipse [radius=2/7];
fill [Yellow50] ellipse [radius=1];
};
scoped{
clip (-1,-2) rectangle ++(2,1);
fill [BlueGrey900] (0,-2) ellipse [radius=1/2];
fill [Grey100]
(-1/2,-2) ellipse [x radius=1/3, y radius=1/4]
( 1/2,-2) ellipse [x radius=1/3, y radius=1/4];
};
foreach i in {-1,1}
foreach j in {-1,0,1}
fill [Grey100, shift={(0,11/8)}, xscale=i, rotate=j*15,
shift=(0:1/2)]
ellipse [x radius=1/3, y radius=1/64];
},
I’d like to change the color of the cat’s tail
Wait wait… Feature location:
Despite a positive experience
here with the cat TikZ,
replications over different TikZ
code representing squid,
chimpanzee, or dogs show that
LLMs are in fact inaccurate.
LLMs can be lucky to guess
which portion of code is
associated to a feature, but
clearly not 100% of the time.
It is problematic since then the
mapping between features and
code element should then be
revised, after manual
investigation.
18
Threats to validity
LLM = ChatGPT4 mainly (also Claude from Anthropic AI and ChatGPT3.5)
Prompts
No control over hyperparameters (eg temperature)
Very few repetitions
Programming variability involves many tasks
19
Potential
LLMs can assist developers in implementing variability in different programming
languages (C, Rust, Java, TikZ, etc.) and mechanisms (conditional compilation, feature
toggles, command-line parameters, template, etc.). With "features as prompts", there is
hope to raise the level of abstraction, increase automation, and bring more flexibility
when synthesizing and exploring software variants.
20
Limitations
LLMs are by construction stochastic, non-determinist and highly sensitive to prompt
variations – and so are corresponding implementations of features and variability.
https://github.com/acherm/progvary-wit
hgpt/blob/main/varyfloatinC/ChatGPT-V
ariable_Type_Alternatives.md
LLM
21
Discussions
(limitations & potential)
LLMs are by construction stochastic, non-determinist and highly sensitive to prompt
variations – and so are corresponding implementations of features and variability.
In particular, LLMs can produce different programs out of the same exact prompt.
Unfortunately, some of these programs can be incomplete or simply wrong, introducing
serious variability errors.
Potential: LLMs act as assistant that recommend some possible implementations of
variability. It is the role of programmers to review the recommendation and either
selects another recommendation or manually implement variability.
LLM
22
Future work
LLMs are by construction stochastic, non-determinist and highly sensitive to prompt
variations – and so are corresponding implementations of features and variability.
#1 A variability benchmark for LLM-based assistant (for assessing accuracy and
robustness)
Challenge: In our case, we target comprehensive programming scenarios that (1)
require combining different pieces of code and (2) call to combine different languages
and technologies for realizing variability. Not easy to automate the “goodness”
assessment of some solutions
LLM
23
Future work
LLMs are by construction stochastic, non-determinist and highly sensitive to prompt
variations – and so are corresponding implementations of features and variability.
#2 Improving the robustness of LLMs
Challenge: how to properly formulate instructions/prompts for programming variability…
informality of NLP can backfire. Dedicated “variability language” for LLM? Specialization
of LLMs for variability tasks?
LLM
24
#1 A variability benchmark for LLM-based assistant
(for assessing accuracy and robustness)
#2 Improving the robustness of LLMs
https://inria.hal.science/hal-04153310/
https://github.com/acherm/progvary-withgpt/
25
Backup slides
26
Remainder of the talk
How LLMs can be concretely and originally used for programming
software variability
Variability implementations of a classical Hello world
Variability for reproducibility and floating-points
Transforming an unfamiliar code with an end-user, Web-based
customization tool
Discussions (potential and limitations)
27
https://github.com/acherm/progvary-withgpt/blob/main/varyfloatinC/ChatGPT-C_Variations_with_%23ifdef.md
https://github.com/acherm/progvary-withgpt/blob/main/varyfloatinC/approx.c
28
https://github.com/acherm/progvary-withgpt/blob/main/varyfloatinC/ChatGPT-C_Variations_with_%23ifdef.md
https://github.com/acherm/progvary-withgpt/blob/main/varyfloatinC/approx_eval.py
29
retrieve the result of S. Boldo et al.
30
31
32

More Related Content

More from University of Rennes, INSA Rennes, Inria/IRISA, CNRS

More from University of Rennes, INSA Rennes, Inria/IRISA, CNRS (20)

24 Reasons Why Variability Models Are Not Yet Universal (24RWVMANYU)
24 Reasons Why Variability Models Are Not Yet Universal (24RWVMANYU)24 Reasons Why Variability Models Are Not Yet Universal (24RWVMANYU)
24 Reasons Why Variability Models Are Not Yet Universal (24RWVMANYU)
 
Generative AI for Reengineering Variants into Software Product Lines: An Expe...
Generative AI for Reengineering Variants into Software Product Lines: An Expe...Generative AI for Reengineering Variants into Software Product Lines: An Expe...
Generative AI for Reengineering Variants into Software Product Lines: An Expe...
 
Tackling Deep Software Variability Together
Tackling Deep Software Variability TogetherTackling Deep Software Variability Together
Tackling Deep Software Variability Together
 
On anti-cheating in chess, science, reproducibility, and variability
On anti-cheating in chess, science, reproducibility, and variabilityOn anti-cheating in chess, science, reproducibility, and variability
On anti-cheating in chess, science, reproducibility, and variability
 
Feature Subset Selection for Learning Huge Configuration Spaces: The case of ...
Feature Subset Selection for Learning Huge Configuration Spaces: The case of ...Feature Subset Selection for Learning Huge Configuration Spaces: The case of ...
Feature Subset Selection for Learning Huge Configuration Spaces: The case of ...
 
Machine Learning and Deep Software Variability
Machine Learning and Deep Software VariabilityMachine Learning and Deep Software Variability
Machine Learning and Deep Software Variability
 
Mastering Software Variability for Innovation and Science
Mastering Software Variability for Innovation and ScienceMastering Software Variability for Innovation and Science
Mastering Software Variability for Innovation and Science
 
Transfer Learning Across Variants and Versions: The Case of Linux Kernel Size
Transfer Learning Across Variants and Versions: The Case of Linux Kernel SizeTransfer Learning Across Variants and Versions: The Case of Linux Kernel Size
Transfer Learning Across Variants and Versions: The Case of Linux Kernel Size
 
Reproducible Science and Deep Software Variability
Reproducible Science and Deep Software VariabilityReproducible Science and Deep Software Variability
Reproducible Science and Deep Software Variability
 
Software Variability and Artificial Intelligence
Software Variability and Artificial IntelligenceSoftware Variability and Artificial Intelligence
Software Variability and Artificial Intelligence
 
Teaching Software Product Lines: A Snapshot of Current Practices and Challenges
Teaching Software Product Lines: A Snapshot of Current Practices and ChallengesTeaching Software Product Lines: A Snapshot of Current Practices and Challenges
Teaching Software Product Lines: A Snapshot of Current Practices and Challenges
 
Exploiting the Enumeration of All Feature Model Configurations: A New Perspec...
Exploiting the Enumeration of All Feature Model Configurations: A New Perspec...Exploiting the Enumeration of All Feature Model Configurations: A New Perspec...
Exploiting the Enumeration of All Feature Model Configurations: A New Perspec...
 
Assessing Product Line Derivation Operators Applied to Java Source Code: An E...
Assessing Product Line Derivation Operators Applied to Java Source Code: An E...Assessing Product Line Derivation Operators Applied to Java Source Code: An E...
Assessing Product Line Derivation Operators Applied to Java Source Code: An E...
 
Synthesis of Attributed Feature Models From Product Descriptions
Synthesis of Attributed Feature Models From Product DescriptionsSynthesis of Attributed Feature Models From Product Descriptions
Synthesis of Attributed Feature Models From Product Descriptions
 
From Basic Variability Models to OpenCompare.org
From Basic Variability Models to OpenCompare.orgFrom Basic Variability Models to OpenCompare.org
From Basic Variability Models to OpenCompare.org
 
Pandoc: a universal document converter
Pandoc: a universal document converterPandoc: a universal document converter
Pandoc: a universal document converter
 
Metamorphic Domain-Specific Languages
Metamorphic Domain-Specific LanguagesMetamorphic Domain-Specific Languages
Metamorphic Domain-Specific Languages
 
3D Printing, Customization, and Product Lines
3D Printing, Customization, and Product Lines3D Printing, Customization, and Product Lines
3D Printing, Customization, and Product Lines
 
WebFML: Synthesizing Feature Models Everywhere (@ SPLC 2014)
WebFML: Synthesizing Feature Models Everywhere (@ SPLC 2014)WebFML: Synthesizing Feature Models Everywhere (@ SPLC 2014)
WebFML: Synthesizing Feature Models Everywhere (@ SPLC 2014)
 
A survey on teaching of software product lines
A survey on teaching of software product linesA survey on teaching of software product lines
A survey on teaching of software product lines
 

Recently uploaded

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 

Recently uploaded (20)

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 

On Programming Variability with Large Language Model-based Assistant

  • 1. On Programming Variability with Large Language Model-based Assistant Mathieu Acher, José A. Galindo, Jean-Marc Jézéquel https://inria.hal.science/hal-04153310/ https://github.com/acherm/progvary-withgpt/ 1
  • 2. 2
  • 3. 3
  • 4. Generative programming [Czarnecki2000], Model-driven engineering: automatically generate variants from a specification written in one or more textual or graphical domain-specific languages Accidental and essential complexity Variability further increases this software complexity: multiple features, code variations, and an exponential number of possible variants 4
  • 5. LLM Hypothesis: Large language models (LLMs) act as a new variability compiler capable of transforming a high-level specification (“prompt”) into variable code, features, generators, configurable systems, etc. written in a given technological space. Motto: “features as prompts” 5
  • 10. “would it be possible to adapt the program as a Web application... and provide a server-side that returns the output while the client side prints it” https://github.com/acherm/progvary-withgpt/blob/main/featuret oggle-helloworld/ChatGPT-Unleash_JS_Feature_Toggles.md 10
  • 11. Here is a TikZ code: tikzset{% something/.pic={ tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}} useasboundingbox (-1,-1) (1,2); fill [BlueGrey900] (0,-2) .. controls ++(180:3) and ++(0:5/4) .. (-2,0) arc (270:90:1/5) .. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5); foreach i in {-1,1} scoped[shift={(1/2*i,9/4)}, rotate=45*i]{ clip [overlay] (0, 5/9) ellipse [radius=8/9]; clip [overlay] (0,-5/9) ellipse [radius=8/9]; fill [BlueGrey900] ellipse [radius=1]; clip [overlay] (0, 7/9) ellipse [radius=10/11]; clip [overlay] (0,-7/9) ellipse [radius=10/11]; fill [Purple100] ellipse [radius=1]; }; fill [BlueGrey900] ellipse [x radius=3/4, y radius=2]; fill [BlueGrey100] ellipse [x radius=1/3, y radius=1]; fill [BlueGrey900] (0,15/8) ellipse [x radius=1, y radius=5/6] (0, 8/6) ellipse [x radius=1/2, y radius=1/2] {[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]} {[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]}; fill [BlueGrey500] (-1/9,11/8) ellipse [x radius=1/5, y radius=1/5] 11
  • 12. Here is a TikZ code: tikzset{% cat/.pic={ tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}} useasboundingbox (-1,-1) (1,2); fill [BlueGrey900] (0,-2) .. controls ++(180:3) and ++(0:5/4) .. (-2,0) arc (270:90:1/5) .. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5); foreach i in {-1,1} scoped[shift={(1/2*i,9/4)}, rotate=45*i]{ clip [overlay] (0, 5/9) ellipse [radius=8/9]; clip [overlay] (0,-5/9) ellipse [radius=8/9]; fill [BlueGrey900] ellipse [radius=1]; clip [overlay] (0, 7/9) ellipse [radius=10/11]; clip [overlay] (0,-7/9) ellipse [radius=10/11]; fill [Purple100] ellipse [radius=1]; }; fill [BlueGrey900] ellipse [x radius=3/4, y radius=2]; fill [BlueGrey100] ellipse [x radius=1/3, y radius=1]; fill [BlueGrey900] (0,15/8) ellipse [x radius=1, y radius=5/6] (0, 8/6) ellipse [x radius=1/2, y radius=1/2] {[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]} {[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]}; fill [BlueGrey500] (-1/9,11/8) ellipse [x radius=1/5, y radius=1/5] ( 1/9,11/8) ellipse [x radius=1/5, y radius=1/5]; fill [Purple100] (0,12/8) ellipse [x radius=1/10, y radius=1/5] (0,12/8+1/9) ellipse [x radius=1/5 , y radius=1/10]; foreach i in {-1,1} scoped[shift={(1/2*i,2)}, rotate=35*i]{ clip [overlay] (0, 1/7) ellipse [radius=2/7]; clip [overlay] (0,-1/7) ellipse [radius=2/7]; fill [Yellow50] ellipse [radius=1]; }; scoped{ clip (-1,-2) rectangle ++(2,1); fill [BlueGrey900] (0,-2) ellipse [radius=1/2]; fill [Grey100] (-1/2,-2) ellipse [x radius=1/3, y radius=1/4] ( 1/2,-2) ellipse [x radius=1/3, y radius=1/4]; }; foreach i in {-1,1} foreach j in {-1,0,1} fill [Grey100, shift={(0,11/8)}, xscale=i, rotate=j*15, 12
  • 13. Here is a TikZ code: tikzset{% cat/.pic={ tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}} useasboundingbox (-1,-1) (1,2); fill [BlueGrey900] (0,-2) .. controls ++(180:3) and ++(0:5/4) .. (-2,0) arc (270:90:1/5) .. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5); foreach i in {-1,1} scoped[shift={(1/2*i,9/4)}, rotate=45*i]{ clip [overlay] (0, 5/9) ellipse [radius=8/9]; clip [overlay] (0,-5/9) ellipse [radius=8/9]; fill [BlueGrey900] ellipse [radius=1]; clip [overlay] (0, 7/9) ellipse [radius=10/11]; clip [overlay] (0,-7/9) ellipse [radius=10/11]; fill [Purple100] ellipse [radius=1]; }; fill [BlueGrey900] ellipse [x radius=3/4, y radius=2]; fill [BlueGrey100] ellipse [x radius=1/3, y radius=1]; fill [BlueGrey900] (0,15/8) ellipse [x radius=1, y radius=5/6] (0, 8/6) ellipse [x radius=1/2, y radius=1/2] {[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]} {[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]}; fill [BlueGrey500] (-1/9,11/8) ellipse [x radius=1/5, y radius=1/5] ( 1/9,11/8) ellipse [x radius=1/5, y radius=1/5]; fill [Purple100] (0,12/8) ellipse [x radius=1/10, y radius=1/5] (0,12/8+1/9) ellipse [x radius=1/5 , y radius=1/10]; foreach i in {-1,1} scoped[shift={(1/2*i,2)}, rotate=35*i]{ clip [overlay] (0, 1/7) ellipse [radius=2/7]; clip [overlay] (0,-1/7) ellipse [radius=2/7]; fill [Yellow50] ellipse [radius=1]; I’d like to change the color of the cat’s tail 13
  • 14. Here is a TikZ code: tikzset{% cat/.pic={ tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}} useasboundingbox (-1,-1) (1,2); fill [BlueGrey900] (0,-2) .. controls ++(180:3) and ++(0:5/4) .. (-2,0) arc (270:90:1/5) .. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5); foreach i in {-1,1} scoped[shift={(1/2*i,9/4)}, rotate=45*i]{ clip [overlay] (0, 5/9) ellipse [radius=8/9]; clip [overlay] (0,-5/9) ellipse [radius=8/9]; fill [BlueGrey900] ellipse [radius=1]; clip [overlay] (0, 7/9) ellipse [radius=10/11]; clip [overlay] (0,-7/9) ellipse [radius=10/11]; fill [Purple100] ellipse [radius=1]; }; fill [BlueGrey900] ellipse [x radius=3/4, y radius=2]; fill [BlueGrey100] ellipse [x radius=1/3, y radius=1]; fill [BlueGrey900] (0,15/8) ellipse [x radius=1, y radius=5/6] (0, 8/6) ellipse [x radius=1/2, y radius=1/2] {[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]} {[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]}; fill [BlueGrey500] (-1/9,11/8) ellipse [x radius=1/5, y radius=1/5] ( 1/9,11/8) ellipse [x radius=1/5, y radius=1/5]; fill [Purple100] (0,12/8) ellipse [x radius=1/10, y radius=1/5] (0,12/8+1/9) ellipse [x radius=1/5 , y radius=1/10]; foreach i in {-1,1} scoped[shift={(1/2*i,2)}, rotate=35*i]{ clip [overlay] (0, 1/7) ellipse [radius=2/7]; clip [overlay] (0,-1/7) ellipse [radius=2/7]; fill [Yellow50] ellipse [radius=1]; I’d like to change the color of the cat’s tail added by ChatGPT! 14
  • 18. Here is a TikZ code: tikzset{% cat/.pic={ tikzset{x=3cm/5,y=3cm/5,shift={(0,-1/3)}} useasboundingbox (-1,-1) (1,2); fill [BlueGrey900] (0,-2) .. controls ++(180:3) and ++(0:5/4) .. (-2,0) arc (270:90:1/5) .. controls ++(0:2) and ++(180:11/4) .. (0,-2+2/5); foreach i in {-1,1} scoped[shift={(1/2*i,9/4)}, rotate=45*i]{ clip [overlay] (0, 5/9) ellipse [radius=8/9]; clip [overlay] (0,-5/9) ellipse [radius=8/9]; fill [BlueGrey900] ellipse [radius=1]; clip [overlay] (0, 7/9) ellipse [radius=10/11]; clip [overlay] (0,-7/9) ellipse [radius=10/11]; fill [Purple100] ellipse [radius=1]; }; fill [BlueGrey900] ellipse [x radius=3/4, y radius=2]; fill [BlueGrey100] ellipse [x radius=1/3, y radius=1]; fill [BlueGrey900] (0,15/8) ellipse [x radius=1, y radius=5/6] (0, 8/6) ellipse [x radius=1/2, y radius=1/2] {[shift={(-1/2,-2)}, rotate= 10] ellipse [x radius=1/3, y radius=5/4]} {[shift={( 1/2,-2)}, rotate=-10] ellipse [x radius=1/3, y radius=5/4]}; fill [BlueGrey500] (-1/9,11/8) ellipse [x radius=1/5, y radius=1/5] ( 1/9,11/8) ellipse [x radius=1/5, y radius=1/5]; fill [Purple100] (0,12/8) ellipse [x radius=1/10, y radius=1/5] (0,12/8+1/9) ellipse [x radius=1/5 , y radius=1/10]; foreach i in {-1,1} scoped[shift={(1/2*i,2)}, rotate=35*i]{ clip [overlay] (0, 1/7) ellipse [radius=2/7]; clip [overlay] (0,-1/7) ellipse [radius=2/7]; fill [Yellow50] ellipse [radius=1]; }; scoped{ clip (-1,-2) rectangle ++(2,1); fill [BlueGrey900] (0,-2) ellipse [radius=1/2]; fill [Grey100] (-1/2,-2) ellipse [x radius=1/3, y radius=1/4] ( 1/2,-2) ellipse [x radius=1/3, y radius=1/4]; }; foreach i in {-1,1} foreach j in {-1,0,1} fill [Grey100, shift={(0,11/8)}, xscale=i, rotate=j*15, shift=(0:1/2)] ellipse [x radius=1/3, y radius=1/64]; }, I’d like to change the color of the cat’s tail Wait wait… Feature location: Despite a positive experience here with the cat TikZ, replications over different TikZ code representing squid, chimpanzee, or dogs show that LLMs are in fact inaccurate. LLMs can be lucky to guess which portion of code is associated to a feature, but clearly not 100% of the time. It is problematic since then the mapping between features and code element should then be revised, after manual investigation. 18
  • 19. Threats to validity LLM = ChatGPT4 mainly (also Claude from Anthropic AI and ChatGPT3.5) Prompts No control over hyperparameters (eg temperature) Very few repetitions Programming variability involves many tasks 19
  • 20. Potential LLMs can assist developers in implementing variability in different programming languages (C, Rust, Java, TikZ, etc.) and mechanisms (conditional compilation, feature toggles, command-line parameters, template, etc.). With "features as prompts", there is hope to raise the level of abstraction, increase automation, and bring more flexibility when synthesizing and exploring software variants. 20
  • 21. Limitations LLMs are by construction stochastic, non-determinist and highly sensitive to prompt variations – and so are corresponding implementations of features and variability. https://github.com/acherm/progvary-wit hgpt/blob/main/varyfloatinC/ChatGPT-V ariable_Type_Alternatives.md LLM 21
  • 22. Discussions (limitations & potential) LLMs are by construction stochastic, non-determinist and highly sensitive to prompt variations – and so are corresponding implementations of features and variability. In particular, LLMs can produce different programs out of the same exact prompt. Unfortunately, some of these programs can be incomplete or simply wrong, introducing serious variability errors. Potential: LLMs act as assistant that recommend some possible implementations of variability. It is the role of programmers to review the recommendation and either selects another recommendation or manually implement variability. LLM 22
  • 23. Future work LLMs are by construction stochastic, non-determinist and highly sensitive to prompt variations – and so are corresponding implementations of features and variability. #1 A variability benchmark for LLM-based assistant (for assessing accuracy and robustness) Challenge: In our case, we target comprehensive programming scenarios that (1) require combining different pieces of code and (2) call to combine different languages and technologies for realizing variability. Not easy to automate the “goodness” assessment of some solutions LLM 23
  • 24. Future work LLMs are by construction stochastic, non-determinist and highly sensitive to prompt variations – and so are corresponding implementations of features and variability. #2 Improving the robustness of LLMs Challenge: how to properly formulate instructions/prompts for programming variability… informality of NLP can backfire. Dedicated “variability language” for LLM? Specialization of LLMs for variability tasks? LLM 24
  • 25. #1 A variability benchmark for LLM-based assistant (for assessing accuracy and robustness) #2 Improving the robustness of LLMs https://inria.hal.science/hal-04153310/ https://github.com/acherm/progvary-withgpt/ 25
  • 27. Remainder of the talk How LLMs can be concretely and originally used for programming software variability Variability implementations of a classical Hello world Variability for reproducibility and floating-points Transforming an unfamiliar code with an end-user, Web-based customization tool Discussions (potential and limitations) 27
  • 30. retrieve the result of S. Boldo et al. 30
  • 31. 31
  • 32. 32