SlideShare a Scribd company logo
1 of 17
Semantic Scaffolds for
Pseudocode-to-Code
Generation
Ruiqi Zhong, Mitchell Stern, Dan Klein
Abstract
⦿ A method for program generation based on semantic scaffolds
⦿ Searching over plausible scaffolds then using these as constraints
for a beam search over programs
⦿ Applied hierarchical search method to the SPoC dataset
2
Contribution
⦿ proposed the use of semantic scaffolds to add semantic
constraints to models for long form language-to-code generation
tasks
⦿ introduced a hierarchical beam search algorithm
⦿ achieved a new state-of-the-art accuracy of 55.1% on the SPoC
dataset
3
2.1 Data
⦿ focused on the SPoC dataset
⦿ It consists of C++ solutions to problems from Code forces
⦿ It contains 18,356 programs in total with 14.7 lines per program
on average
4
2.2 Task
⦿ Suppose the target program has L lines
⦿ Natural language pseudocode annotation 𝑥𝑙 and an indentation
level 𝑖𝑙
⦿ Goal is to find a candidate program y based on (𝑥1; 𝑖1); : : : ; (𝑥𝐿; 𝑖𝑙)
5
3. Combination Constraints
⦿ this approach ignores any dependence between different lines
⦿ if we naively combine certain subsets of candidates together, the
resulting program will be invalid due to the use of undeclared
variables or mismatching braces
⦿ we propose to enforce certain syntactic and semantic constraints
when combining candidate code pieces
6
3.1 Syntactic Constraints
⦿ restrict our attention to the set of “primary expressions”
consisting of high-level control structures such as if, else
⦿ parse the candidate code pieces for each line into a list of primary
expression symbols
⦿ exist a grammatical derivation that combines their respective
symbols
7
3.2 Symbol Table Constraints
⦿ this approach ignores any dependence between different lines
⦿ extract the variable names
⌾ undeclared variables are not used
⌾ variables are not re-declared within the same scope
8
4.1 Beam Search
⦿ The search begins with k randomly generated states
⦿ At each step, all the successors of all k states are generated
⦿ If any one of the successors is a goal, the algorithm halts
⦿ Otherwise, it selects the k best successors from the complete list
and repeats
9
4.1 Beam Search
⦿ Advantages:
⌾ potentially reducing the time, of a search
⌾ the memory consumption of the search is less than others
⦿ Disadvantages:
⌾ the search may not result in an optimal goal and may not
even reach a goal at all
⌾ terminates for two cases: a required goal node is reached, or
a goal node is not reached and there are no nodes left to be
explored 10
5. Implementation (Empty Pseudocode)
⦿ 26% of the lines in the data set do not have pseudocode
annotations
⦿ Such as “int main() {”, “{”, “}”, etc.
⦿ They did not use the any code pieces for these lines
11
5. Implementation
⦿ Empty Pseudocode
⌾ “int main() -> {”, “{”, “}”,
⦿ Search Algorithm
⌾ OpenNMT
⦿ Parsing Code Pieces
⦿ Search Algorithm
12
5. Implementation (Search Algorithm
Hyper parameters)
⦿ They consider the top C = 100 code pieces for each line
⦿ default beam width W is 50 for scaffold search
⦿ the top K = 20 scaffolds for the subsequent generation
13
6.2 Comparison of Constraints
Figure: (a) Candidate code pieces and their syntactic/Symtable configuration for each line; (b)
use beam search to find highest scoring valid scaffolds; (c) given a scaffold, select code pieces
that has the same configurations for each line. (d) combine code pieces to form full program.
14
6.2 Comparison of Constraints
⦿ No Constraints: the best-first search method that scores lines
independently.
⦿ Syntactic Constraints: the constraints on the primary expression
and indentation level
⦿ Symbol Table Constraints: both the syntactic constraints and the
symbol table constraints described
⦿ Back off: sometimes hierarchical beam search with the SymTable
constraints fails to return any valid scaffold. We back off to just
the Syntactic constraints if this happens.
15
7.2 Rejection by Constraints
⦿ Syntactic Constraints:
⌾ “}”, “int main(){”, “{”, ”return 0”, “};”
⌾ if(...){” and “if(...)”
⦿ Symbol Table (SymTable) Constraints
⌾ Set N to 222222 -> int N = 222222 or int N = 222222
16
7.3 Code Piece Error Analysis
⦿ The model generation is wrong despite clear pseudocode
⦿ variable type clarification
⦿ Syntactic context
⦿ consists of variable name types
17

More Related Content

What's hot

Modeling and Evaluation of Performance and Reliability of Component-based So...
Modeling and Evaluation of Performance and Reliability  of Component-based So...Modeling and Evaluation of Performance and Reliability  of Component-based So...
Modeling and Evaluation of Performance and Reliability of Component-based So...Editor IJCATR
 
Theta: a Framework for Abstraction Refinement-Based Model Checking
Theta: a Framework for Abstraction Refinement-Based Model CheckingTheta: a Framework for Abstraction Refinement-Based Model Checking
Theta: a Framework for Abstraction Refinement-Based Model CheckingAkos Hajdu
 
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...Jinho Choi
 
Scope - Static and Dynamic
Scope - Static and DynamicScope - Static and Dynamic
Scope - Static and DynamicSneh Pahilwani
 
A time study in numerical methods programming
A time study in numerical methods programmingA time study in numerical methods programming
A time study in numerical methods programmingGlen Alleman
 
9781285852744 ppt ch08
9781285852744 ppt ch089781285852744 ppt ch08
9781285852744 ppt ch08Terry Yoast
 
1212 regular meeting
1212 regular meeting1212 regular meeting
1212 regular meetingmarxliouville
 
Bt0066 database management system2
Bt0066 database management system2Bt0066 database management system2
Bt0066 database management system2Techglyphs
 
Data Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptxData Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptxR S Anu Prabha
 
3 statements and operators
3   statements and operators3   statements and operators
3 statements and operatorsTuan Ngo
 
Information Flow based Ontology Mapping - 2002
Information Flow based Ontology Mapping - 2002Information Flow based Ontology Mapping - 2002
Information Flow based Ontology Mapping - 2002Yannis Kalfoglou
 
Numeric Data types in Python
Numeric Data types in PythonNumeric Data types in Python
Numeric Data types in Pythonjyostna bodapati
 
Test 3 exam review guide
Test 3 exam review guideTest 3 exam review guide
Test 3 exam review guidebgb02burns
 
20100522 software verification_sharygina_lecture02
20100522 software verification_sharygina_lecture0220100522 software verification_sharygina_lecture02
20100522 software verification_sharygina_lecture02Computer Science Club
 

What's hot (17)

Modeling and Evaluation of Performance and Reliability of Component-based So...
Modeling and Evaluation of Performance and Reliability  of Component-based So...Modeling and Evaluation of Performance and Reliability  of Component-based So...
Modeling and Evaluation of Performance and Reliability of Component-based So...
 
Theta: a Framework for Abstraction Refinement-Based Model Checking
Theta: a Framework for Abstraction Refinement-Based Model CheckingTheta: a Framework for Abstraction Refinement-Based Model Checking
Theta: a Framework for Abstraction Refinement-Based Model Checking
 
LISP: Scope and extent in lisp
LISP: Scope and extent in lispLISP: Scope and extent in lisp
LISP: Scope and extent in lisp
 
Day 2 Chapter 1 Unit 1
Day 2 Chapter 1 Unit 1Day 2 Chapter 1 Unit 1
Day 2 Chapter 1 Unit 1
 
Compiler lecture 07
Compiler lecture 07Compiler lecture 07
Compiler lecture 07
 
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
Adaptation of Multilingual Transformer Encoder for Robust Enhanced Universal ...
 
Scope - Static and Dynamic
Scope - Static and DynamicScope - Static and Dynamic
Scope - Static and Dynamic
 
A time study in numerical methods programming
A time study in numerical methods programmingA time study in numerical methods programming
A time study in numerical methods programming
 
9781285852744 ppt ch08
9781285852744 ppt ch089781285852744 ppt ch08
9781285852744 ppt ch08
 
1212 regular meeting
1212 regular meeting1212 regular meeting
1212 regular meeting
 
Bt0066 database management system2
Bt0066 database management system2Bt0066 database management system2
Bt0066 database management system2
 
Data Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptxData Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptx
 
3 statements and operators
3   statements and operators3   statements and operators
3 statements and operators
 
Information Flow based Ontology Mapping - 2002
Information Flow based Ontology Mapping - 2002Information Flow based Ontology Mapping - 2002
Information Flow based Ontology Mapping - 2002
 
Numeric Data types in Python
Numeric Data types in PythonNumeric Data types in Python
Numeric Data types in Python
 
Test 3 exam review guide
Test 3 exam review guideTest 3 exam review guide
Test 3 exam review guide
 
20100522 software verification_sharygina_lecture02
20100522 software verification_sharygina_lecture0220100522 software verification_sharygina_lecture02
20100522 software verification_sharygina_lecture02
 

Similar to Semantic scaffolds for pseudocode to-code generation (2020)

SPoC: search-based pseudocode to code
SPoC: search-based pseudocode to codeSPoC: search-based pseudocode to code
SPoC: search-based pseudocode to codeMinhazul Arefin
 
CC week 1.pptx
CC week 1.pptxCC week 1.pptx
CC week 1.pptxkkjk4
 
techniques for removing smallest Stopping sets in LDPC codes
techniques for removing smallest Stopping sets in LDPC codestechniques for removing smallest Stopping sets in LDPC codes
techniques for removing smallest Stopping sets in LDPC codesShankar Lal
 
Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationAkhil Kaushik
 
0-Slot05-06-07-Basic-Logics.pdf
0-Slot05-06-07-Basic-Logics.pdf0-Slot05-06-07-Basic-Logics.pdf
0-Slot05-06-07-Basic-Logics.pdfssusere19c741
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016Ankit Dubey
 
Software testing strategies
Software testing strategiesSoftware testing strategies
Software testing strategiesKrishna Sujeer
 
Lexically constrained decoding for sequence generation using grid beam search
Lexically constrained decoding for sequence generation using grid beam searchLexically constrained decoding for sequence generation using grid beam search
Lexically constrained decoding for sequence generation using grid beam searchSatoru Katsumata
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Introduction to Compilers
Introduction to CompilersIntroduction to Compilers
Introduction to Compilersvijaya603274
 
Course Breakup Plan- C
Course Breakup Plan- CCourse Breakup Plan- C
Course Breakup Plan- Cswatisinghal
 
Fractal analysis of good programming style
Fractal analysis of good programming styleFractal analysis of good programming style
Fractal analysis of good programming stylecsandit
 
FRACTAL ANALYSIS OF GOOD PROGRAMMING STYLE
FRACTAL ANALYSIS OF GOOD PROGRAMMING STYLEFRACTAL ANALYSIS OF GOOD PROGRAMMING STYLE
FRACTAL ANALYSIS OF GOOD PROGRAMMING STYLEcscpconf
 
Scalable up genomic analysis with ADAM
Scalable up genomic analysis with ADAMScalable up genomic analysis with ADAM
Scalable up genomic analysis with ADAMfnothaft
 
Pattern-based Definition and Generation of Components for a Synchronous React...
Pattern-based Definition and Generation of Components for a Synchronous React...Pattern-based Definition and Generation of Components for a Synchronous React...
Pattern-based Definition and Generation of Components for a Synchronous React...ijeukens
 
Algorithm Specification and Data Abstraction
Algorithm Specification and Data Abstraction Algorithm Specification and Data Abstraction
Algorithm Specification and Data Abstraction Ashutosh Satapathy
 
The Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source SoftwareThe Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source SoftwareAndrey Karpov
 

Similar to Semantic scaffolds for pseudocode to-code generation (2020) (20)

SPoC: search-based pseudocode to code
SPoC: search-based pseudocode to codeSPoC: search-based pseudocode to code
SPoC: search-based pseudocode to code
 
Introduction to algorithms
Introduction to algorithmsIntroduction to algorithms
Introduction to algorithms
 
CC week 1.pptx
CC week 1.pptxCC week 1.pptx
CC week 1.pptx
 
techniques for removing smallest Stopping sets in LDPC codes
techniques for removing smallest Stopping sets in LDPC codestechniques for removing smallest Stopping sets in LDPC codes
techniques for removing smallest Stopping sets in LDPC codes
 
Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code Generation
 
Symbolic Execution And KLEE
Symbolic Execution And KLEESymbolic Execution And KLEE
Symbolic Execution And KLEE
 
0-Slot05-06-07-Basic-Logics.pdf
0-Slot05-06-07-Basic-Logics.pdf0-Slot05-06-07-Basic-Logics.pdf
0-Slot05-06-07-Basic-Logics.pdf
 
Fy secondsemester2016
Fy secondsemester2016Fy secondsemester2016
Fy secondsemester2016
 
Software testing strategies
Software testing strategiesSoftware testing strategies
Software testing strategies
 
Lexically constrained decoding for sequence generation using grid beam search
Lexically constrained decoding for sequence generation using grid beam searchLexically constrained decoding for sequence generation using grid beam search
Lexically constrained decoding for sequence generation using grid beam search
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Introduction to Compilers
Introduction to CompilersIntroduction to Compilers
Introduction to Compilers
 
Course Breakup Plan- C
Course Breakup Plan- CCourse Breakup Plan- C
Course Breakup Plan- C
 
Fractal analysis of good programming style
Fractal analysis of good programming styleFractal analysis of good programming style
Fractal analysis of good programming style
 
FRACTAL ANALYSIS OF GOOD PROGRAMMING STYLE
FRACTAL ANALYSIS OF GOOD PROGRAMMING STYLEFRACTAL ANALYSIS OF GOOD PROGRAMMING STYLE
FRACTAL ANALYSIS OF GOOD PROGRAMMING STYLE
 
Scalable up genomic analysis with ADAM
Scalable up genomic analysis with ADAMScalable up genomic analysis with ADAM
Scalable up genomic analysis with ADAM
 
Pattern-based Definition and Generation of Components for a Synchronous React...
Pattern-based Definition and Generation of Components for a Synchronous React...Pattern-based Definition and Generation of Components for a Synchronous React...
Pattern-based Definition and Generation of Components for a Synchronous React...
 
Algorithm Specification and Data Abstraction
Algorithm Specification and Data Abstraction Algorithm Specification and Data Abstraction
Algorithm Specification and Data Abstraction
 
The Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source SoftwareThe Use of Static Code Analysis When Teaching or Developing Open-Source Software
The Use of Static Code Analysis When Teaching or Developing Open-Source Software
 
FivaTech
FivaTechFivaTech
FivaTech
 

More from Minhazul Arefin

Controlling Home Appliances adopting Chatbot using Machine Learning Approach
Controlling Home Appliances adopting Chatbot using Machine Learning ApproachControlling Home Appliances adopting Chatbot using Machine Learning Approach
Controlling Home Appliances adopting Chatbot using Machine Learning ApproachMinhazul Arefin
 
Object Detection on Dental X-ray Images using R-CNN
Object Detection on Dental X-ray Images using R-CNNObject Detection on Dental X-ray Images using R-CNN
Object Detection on Dental X-ray Images using R-CNNMinhazul Arefin
 
Natural Language Query to SQL conversion using Machine Learning Approach
Natural Language Query to SQL conversion using Machine Learning ApproachNatural Language Query to SQL conversion using Machine Learning Approach
Natural Language Query to SQL conversion using Machine Learning ApproachMinhazul Arefin
 
Efficient estimation of word representations in vector space (2013)
Efficient estimation of word representations in vector space (2013)Efficient estimation of word representations in vector space (2013)
Efficient estimation of word representations in vector space (2013)Minhazul Arefin
 
Recurrent neural networks (rnn) and long short term memory networks (lstm)
Recurrent neural networks (rnn) and long short term memory networks (lstm)Recurrent neural networks (rnn) and long short term memory networks (lstm)
Recurrent neural networks (rnn) and long short term memory networks (lstm)Minhazul Arefin
 
The rise of “Big Data” on cloud computing
The rise of “Big Data” on cloud computingThe rise of “Big Data” on cloud computing
The rise of “Big Data” on cloud computingMinhazul Arefin
 

More from Minhazul Arefin (6)

Controlling Home Appliances adopting Chatbot using Machine Learning Approach
Controlling Home Appliances adopting Chatbot using Machine Learning ApproachControlling Home Appliances adopting Chatbot using Machine Learning Approach
Controlling Home Appliances adopting Chatbot using Machine Learning Approach
 
Object Detection on Dental X-ray Images using R-CNN
Object Detection on Dental X-ray Images using R-CNNObject Detection on Dental X-ray Images using R-CNN
Object Detection on Dental X-ray Images using R-CNN
 
Natural Language Query to SQL conversion using Machine Learning Approach
Natural Language Query to SQL conversion using Machine Learning ApproachNatural Language Query to SQL conversion using Machine Learning Approach
Natural Language Query to SQL conversion using Machine Learning Approach
 
Efficient estimation of word representations in vector space (2013)
Efficient estimation of word representations in vector space (2013)Efficient estimation of word representations in vector space (2013)
Efficient estimation of word representations in vector space (2013)
 
Recurrent neural networks (rnn) and long short term memory networks (lstm)
Recurrent neural networks (rnn) and long short term memory networks (lstm)Recurrent neural networks (rnn) and long short term memory networks (lstm)
Recurrent neural networks (rnn) and long short term memory networks (lstm)
 
The rise of “Big Data” on cloud computing
The rise of “Big Data” on cloud computingThe rise of “Big Data” on cloud computing
The rise of “Big Data” on cloud computing
 

Recently uploaded

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 

Recently uploaded (20)

Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 

Semantic scaffolds for pseudocode to-code generation (2020)

  • 2. Abstract ⦿ A method for program generation based on semantic scaffolds ⦿ Searching over plausible scaffolds then using these as constraints for a beam search over programs ⦿ Applied hierarchical search method to the SPoC dataset 2
  • 3. Contribution ⦿ proposed the use of semantic scaffolds to add semantic constraints to models for long form language-to-code generation tasks ⦿ introduced a hierarchical beam search algorithm ⦿ achieved a new state-of-the-art accuracy of 55.1% on the SPoC dataset 3
  • 4. 2.1 Data ⦿ focused on the SPoC dataset ⦿ It consists of C++ solutions to problems from Code forces ⦿ It contains 18,356 programs in total with 14.7 lines per program on average 4
  • 5. 2.2 Task ⦿ Suppose the target program has L lines ⦿ Natural language pseudocode annotation 𝑥𝑙 and an indentation level 𝑖𝑙 ⦿ Goal is to find a candidate program y based on (𝑥1; 𝑖1); : : : ; (𝑥𝐿; 𝑖𝑙) 5
  • 6. 3. Combination Constraints ⦿ this approach ignores any dependence between different lines ⦿ if we naively combine certain subsets of candidates together, the resulting program will be invalid due to the use of undeclared variables or mismatching braces ⦿ we propose to enforce certain syntactic and semantic constraints when combining candidate code pieces 6
  • 7. 3.1 Syntactic Constraints ⦿ restrict our attention to the set of “primary expressions” consisting of high-level control structures such as if, else ⦿ parse the candidate code pieces for each line into a list of primary expression symbols ⦿ exist a grammatical derivation that combines their respective symbols 7
  • 8. 3.2 Symbol Table Constraints ⦿ this approach ignores any dependence between different lines ⦿ extract the variable names ⌾ undeclared variables are not used ⌾ variables are not re-declared within the same scope 8
  • 9. 4.1 Beam Search ⦿ The search begins with k randomly generated states ⦿ At each step, all the successors of all k states are generated ⦿ If any one of the successors is a goal, the algorithm halts ⦿ Otherwise, it selects the k best successors from the complete list and repeats 9
  • 10. 4.1 Beam Search ⦿ Advantages: ⌾ potentially reducing the time, of a search ⌾ the memory consumption of the search is less than others ⦿ Disadvantages: ⌾ the search may not result in an optimal goal and may not even reach a goal at all ⌾ terminates for two cases: a required goal node is reached, or a goal node is not reached and there are no nodes left to be explored 10
  • 11. 5. Implementation (Empty Pseudocode) ⦿ 26% of the lines in the data set do not have pseudocode annotations ⦿ Such as “int main() {”, “{”, “}”, etc. ⦿ They did not use the any code pieces for these lines 11
  • 12. 5. Implementation ⦿ Empty Pseudocode ⌾ “int main() -> {”, “{”, “}”, ⦿ Search Algorithm ⌾ OpenNMT ⦿ Parsing Code Pieces ⦿ Search Algorithm 12
  • 13. 5. Implementation (Search Algorithm Hyper parameters) ⦿ They consider the top C = 100 code pieces for each line ⦿ default beam width W is 50 for scaffold search ⦿ the top K = 20 scaffolds for the subsequent generation 13
  • 14. 6.2 Comparison of Constraints Figure: (a) Candidate code pieces and their syntactic/Symtable configuration for each line; (b) use beam search to find highest scoring valid scaffolds; (c) given a scaffold, select code pieces that has the same configurations for each line. (d) combine code pieces to form full program. 14
  • 15. 6.2 Comparison of Constraints ⦿ No Constraints: the best-first search method that scores lines independently. ⦿ Syntactic Constraints: the constraints on the primary expression and indentation level ⦿ Symbol Table Constraints: both the syntactic constraints and the symbol table constraints described ⦿ Back off: sometimes hierarchical beam search with the SymTable constraints fails to return any valid scaffold. We back off to just the Syntactic constraints if this happens. 15
  • 16. 7.2 Rejection by Constraints ⦿ Syntactic Constraints: ⌾ “}”, “int main(){”, “{”, ”return 0”, “};” ⌾ if(...){” and “if(...)” ⦿ Symbol Table (SymTable) Constraints ⌾ Set N to 222222 -> int N = 222222 or int N = 222222 16
  • 17. 7.3 Code Piece Error Analysis ⦿ The model generation is wrong despite clear pseudocode ⦿ variable type clarification ⦿ Syntactic context ⦿ consists of variable name types 17