Video: OOP principles are not dead! These and other traditional coding models, Armando Solar-Lezama says, can be applied to learning
Armando Solar-Lezama’s work goes directly into the heart of the differences between two fundamental models – programming and machine learning, and responds to that nagging question: is programming obsolete?
Starting with ‘why we like programming,’ Solar-Lezama pointed out the value of generalization, modularity and encapsulation.
In these types of systems, he said, different pieces of code have different responsibilities.
“If something fails, if something is … going wrong,” he said, “if you want to change how one particular piece of the code is behaving, you know exactly what part of the code to go to.”
(image caption: Modularity, Solar-Lezama points out, is a time-tested approach)
He also mentioned incremental development where a codebase can emerge over a long time, possibly decades, being added onto by programmers in ways that fit their schedules.
“Every part of the code has its role,” he said. “Every part of the code has a particular task.”
Noting that deep learning has in some ways “crashed the party” and turned the relationship between humans and machines on his head, Solar-Lezama talked about how modern technologies turn data into functions automatically, with no prior knowledge needed.
“You let the data speak for itself,” he said.
However, he added, a hybrid approach might be favorable at the end of the day.
Presenting a paper titled “synthesizing programmatic policies that inductively generalize,” Solar-Lezama talked about having controllers for repetitive motions.
“It’s great to learn from data, it’s great to be able to start with relatively little knowledge and allow the data to speak for itself,” he said. “But we want the generalization: we want to be able to take this piece of code, and in some cases even prove that (it is) actually going to work (for all cases) … we’d like to be able to tell: ‘this part is doing this, and this part is doing that, and this part is responsible for this’. We’d like to be able to add functionality as we go, and build that knowledge base in order to get the system, over time, to do the things we want it to do. … so what we’re really looking for, in other words, is synergy between the things that we know how to do with programming languages, and …. the things that are enabled by the ability to learn.”
Solar-Lezama talked at length about an example of trying to teach a program to parallel park in a streetside parking space, and showed a visualization of how this may or may not work for deep learning based on inputs.
“This is a kind of simple generalization that … we’re pretty good at,” he said. “We know what to do when we do it once, and we know what to do when it has to be done twice. And we know that … if we keep doing this, it’s going to get better and better. And then we’re going to be out of that parking spot.”
In some cases, though, he pointed out the neural networks fail because they don’t have enough test cases where inductive generalization could help solve that problem.
For example, Solar-Lezama suggested adding program structure with hybrid controllers.
Another example, he said, is systems that can be instrumental in synthesizing basic programs.
Solar-Lezama gave the example of graduate students designing a language, and setting up a list of target shapes that they want to generate with low-level instructions like ‘pen up’ and ‘pen down’.
“Some of these (characters) are pretty intricate forms,” he said, showing off some of the ideas that researchers came up with. “(It) would actually require fairly elaborate programs in order to produce (them). But the idea is, if you have a (set) like this, you can go and tell your program synthesizer ‘find me programs that can generate as many of these things as possible…
It’s pretty hard to generate those programs because they have to be very big, you can learn a few. And from those few, you can actually apply more symbolic reasoning techniques that come from the program analysis world, to figure out: what are the basic building blocks that encapsulate everything we’ve learned from running these programs.”
Then, he said, engineers can try out different ways of combining those smaller instructions, into more elaborate and muscular modules that can do the higher-level and more complex generation.
He presented a ‘DreamCoder’ algorithm with a ‘wake/sleep’ model that’s instructive in thinking about how the commands of a program are generated.
“You have a neural network that can help you with this, you have new components that you can bring to the party,” he said. “And very quickly, you can learn to (work with) components that can even do some fairly intricate things. And you can learn the stacks of components… that can do things with relatively little code, that actually look fairly intricate.”
Those synergies, he said, work in these and other examples to show how classical programming or coding complements AI/ML.
“These are just a handful of things you can do when you bring together some of the things that we know from how to write programs and from the world of programming languages, with the things that we know from the world of machine learning,” he said.
Solar-Lezama is an MIT professor who has published multiple pieces about the role of AI in modern technology.