how far can machines go
play

How Far Can Machines Go? Hila Peleg Technion Laziness Laziness - PowerPoint PPT Presentation

Automatic Programming: How Far Can Machines Go? Hila Peleg Technion Laziness Laziness Impatience Laziness Impatience Hubris Automatic Programming Clean up my spreadsheet! Right away, boss! Program synthesis to the rescue Program


  1. Automatic Programming: How Far Can Machines Go? Hila Peleg Technion

  2. Laziness

  3. Laziness Impatience

  4. Laziness Impatience Hubris

  5. Automatic Programming Clean up my spreadsheet! Right away, boss!

  6. Program synthesis to the rescue

  7. Program Synthesis ⇒ ⇒

  8. What we really want This is what I want ⇒ ⇒

  9. What if we have automatic programming? • Hyper-intelligent program generation for your every need

  10. What if we have automatic programming? • Hyper-intelligent program generation for your every need • Self-aware, self-augmenting AI

  11. What if we have automatic programming? • Hyper-intelligent program generation for your every need • Self-aware, self-augmenting AI • The singularity

  12. What if we have automatic programming? • Hyper-intelligent program generation for your every need • Self-aware, self-augmenting AI • The singularity • ???

  13. What if we have automatic programming? • Hyper-intelligent program generation for your every need • Self-aware, self-augmenting AI • The singularity • ??? • THE ROBOT APOCALYPSE

  14. The Robot Apocalypse

  15. But it’s ok!

  16. But it’s ok! Understand users Build a program

  17. But it’s ok! Understand users Build a program Generalizing partial intent is hard

  18. But it’s ok! Understand users Build a program Generalizing Solving HALT partial intent is is hard* hard

  19. User intent is hard Clean up my spreadsheet! Right away, boss!

  20. User intent is hard What’s “clean”? Is this right? Clean up my spreadsheet! What am I doing Right away, boss! with my life?

  21. Intent via examples

  22. Intent via examples

  23. Intent via examples

  24. Intent via examples

  25. Query knowledge about (some kind of) code I want to apply foo() to requests to my http server

  26. Query knowledge about (some kind of) code val routes : Route = ??? I want to apply foo() to val bindingFuture = Http(). requests to my http server bindAndHandle(routes, "localhost", 8080)

  27. Commit Strip said it best… http://www.commitstrip.com/en/2016/08/25/a-very-comprehensive-and-precise-spec/

  28. Commit Strip said it best… http://www.commitstrip.com/en/2016/08/25/a-very-comprehensive-and-precise-spec/

  29. Commit Strip said it best… http://www.commitstrip.com/en/2016/08/25/a-very-comprehensive-and-precise-spec/

  30. Commit Strip said it best… http://www.commitstrip.com/en/2016/08/25/a-very-comprehensive-and-precise-spec/

  31. Building a program is also hard* Get me a program that takes a program and an input and tells me if that program stops on that input.

  32. Building a program is also hard* Get me a program that takes a program and an input and tells me if that program stops on that input. (i.e., the halting problem)

  33. Adjusting our expectations Here’s a grammar of 20 functions and 10 constants, get me a program that I’m certain is in this space.

  34. Adjusting our expectations Here’s a grammar of 20 functions and 10 constants, get me a program that I’m certain is in this space.

  35. Adjusting our expectations Here’s a grammar of 20 functions and 10 constants, get me a program that I’m certain is in this space.

  36. What does this all mean?

  37. What does this all mean? • Generally, “find me a program that—” cannot be solved

  38. What does this all mean? • Generally, “find me a program that—” cannot be solved • Still, we’re not giving up

  39. What does this all mean? • Generally, “find me a program that—” cannot be solved • Still, we’re not giving up • Realistic expectations for realistic program synthesis

  40. Realistic expectations for realistic synthesis We still want But we’ll have to live without • Partial specifications • Checking every possible program • To not have to know • Fully automatic solution everything • A result! • Single-step solution

  41. Realistic expectations for realistic synthesis We still want But we’ll have to live without • Partial specifications • Checking every possible program • To not have to know • Fully automatic solution everything Synthesis Engine Interaction Model • A result! • Single-step solution

  42. The synthesis engine • Predicts code for intent • Draws its understanding from language syntax • and/or crowd wisdom • and/or semantic specifications • Reduce the number of programs seen

  43. Reducing equivalent programs • We’ve seen x+y , so we don’t want y+x

  44. Reducing equivalent programs • We’ve seen x+y , so we don’t want y+x • But how do we know they’re the same?

  45. Reducing equivalent programs • We’ve seen x+y , so we don’t want y+x • But how do we know they’re the same? 1. Heuristics

  46. Reducing equivalent programs • We’ve seen x+y , so we don’t want y+x • But how do we know they’re the same? 1. Heuristics 2. Solvers (e.g., Z3)

  47. Reducing equivalent programs • We’ve seen x+y , so we don’t want y+x • But how do we know they’re the same? 1. Heuristics 2. Solvers (e.g., Z3) 3. Observational Equivalence

  48. Reducing equivalent programs • We’ve seen x+y , so we don’t Equivalence: want y+x 𝑞 1 ≡ 𝑞 2 i.f.f. for every possible input 𝑗 ever, 𝑞 1 𝑗 = 𝑞 2 (𝑗) • But how do we know they’re the same? 1. Heuristics 2. Solvers (e.g., Z3) 3. Observational Equivalence

  49. Reducing equivalent programs • We’ve seen x+y , so we don’t Equivalence: want y+x 𝑞 1 ≡ 𝑞 2 i.f.f. for every possible input 𝑗 ever, 𝑞 1 𝑗 = 𝑞 2 (𝑗) • But how do we know they’re the same? 1. Heuristics Observational equivalence: 2. Solvers (e.g., Z3) 𝑞 1 ≡ 𝑃𝐹 𝑞 2 i.f.f. for every input 𝑗 the user cares about, 𝑞 1 𝑗 = 𝑞 2 (𝑗) 3. Observational Equivalence

  50. Trying a different strategy altogether • Use knowledge bases instead of the language grammar • They no longer contain every program (neither limited grammars) • Searchable via graph algorithms or probability equations

  51. The Interaction Model • Aimed at programmers • Specify intent • Express yourself • Think like a programmer

  52. Specifying (and re-specifying) intent Task: find the median of a list User: examples! 1. [1,2,3] → 2 2. [7,8,7,3] → 7 Synthesis engine: input[input.length/2] User:

  53. Specifying (and re-specifying) intent Task: find the median of a list It managed to find a User: examples! single formula, let’s 1. [1,2,3] → 2 make a counterexample 2. [7,8,7,3] → 7 Synthesis engine: input[input.length/2] User:

  54. Specifying (and re-specifying) intent Task: find the median of a list It managed to find a User: examples! Principle #1: single formula, let’s 1. [1,2,3] → 2 Cost of communicating intent + make a counterexample 2. [7,8,7,3] → 7 consuming result << cost of Synthesis engine: manually performing the task input[input.length/2] User:

  55. Programming Not Only by Example • A programmer can talk at input[input.length/2] the level of the program [] • Read debug info • Reason about subtrees or input / sequences of methods • Even rewrite the program . 2 • But also give examples, if those happen to be easier input length

  56. Programming Not Only by Example • A programmer can talk at input[input.length/2] the level of the program [] Exclude • Read debug info • Reason about subtrees or input / sequences of methods • Even rewrite the program . 2 • But also give examples, if Retain those happen to be easier input length

  57. Programming Not Only by Example • A programmer can talk at input[input.length/2] the level of the program [] Exclude • Read debug info Principle #2: • Reason about subtrees or Let developers be developers input / sequences of methods • Even rewrite the program . 2 • But also give examples, if Retain those happen to be easier input length

  58. When models “out - think” the programmer def counts(l : List[String]) : Map[String,Int]= l.

  59. When models “out - think” the programmer def counts(l : List[String]) : Map[String,Int]= l. groupBy( map( fold(

  60. When models “out - think” the programmer def counts(l : List[String]) : Map[String,Int]= l. groupBy( identity) x => x.length) x => x[0])

  61. When models “out - think” the programmer def counts(l : List[String]) : Map[String,Int]= l. groupBy(identity) . map(x => x._1 -> x._2 x => x.length) x => x[0])

  62. When models “out - think” the programmer def counts(l : List[String]) : Map[String,Int]= l. groupBy(identity) . map(x => x._1 -> x._2. filter(y => y.startsWith( x._2.length x._2[0])

  63. When models “out - think” the programmer def counts(l : List[String]) : Map[String,Int]= l. groupBy(identity) . map(x => x._1 -> x._2. filter(y => y.startsWith(

  64. When models “out - think” the programmer def counts(l : List[String]) : Map[String,Int]= l. groupBy(identity) . map(x => x._1 -> x._2. filter(y => y.startsWith(

  65. Keep understanding what’s going on ??

  66. Keep understanding what’s going on ??

Recommend


More recommend