Se ha denunciado esta presentación.
Se está descargando tu SlideShare. ×

Software Modeling and Artificial Intelligence: friends or foes?

Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Anuncio
Cargando en…3
×

Eche un vistazo a continuación

1 de 85 Anuncio

Software Modeling and Artificial Intelligence: friends or foes?

Descargar para leer sin conexión

See how modeling can help the AI world (e.g. a model-driven approach to build chatbots) and how AI can create smarter modeling tools (e.g. using ML to learn transformations and code generation templates)

See how modeling can help the AI world (e.g. a model-driven approach to build chatbots) and how AI can create smarter modeling tools (e.g. using ML to learn transformations and code generation templates)

Anuncio
Anuncio

Más Contenido Relacionado

Presentaciones para usted (20)

Similares a Software Modeling and Artificial Intelligence: friends or foes? (20)

Anuncio

Más de Jordi Cabot (20)

Más reciente (20)

Anuncio

Software Modeling and Artificial Intelligence: friends or foes?

  1. 1. Modeling and AI: Friends or foes Jordi Cabot @softmodeling – jordicabot.com June 2019
  2. 2. About
  3. 3. SOM Research Lab Software runs the world. Models run the software
  4. 4. Our mission We are interested in the broad area of systems and software engineering, especially promoting the rigorous use of models and engineering principles while keeping an eye on the most unpredictable element in any project: the people. Flickr/clement127
  5. 5. The AI subteam
  6. 6. Preliminaries
  7. 7. Model-Driven Engineering
  8. 8. https://mdse-book.com/
  9. 9. To model, or not to model, this is the WRONG question - Shakespeare
  10. 10. Artificial Intelligence
  11. 11. Cognification: The application of knowledge to boost the performance and impact of a process
  12. 12. Cognification Artificial Intelligence Machine Learning Deep Learning
  13. 13. © Prof. Dr. Andreas Vogelsang – TU Berlin
  14. 14. Why should you care?
  15. 15. Kai-Fu Lee
  16. 16. AI Coder
  17. 17. Modeler
  18. 18. How can we be friends: (1) MDE for AI
  19. 19. • Grady Booch – history of softwre engineering The entire history of software engineering is that of the rise in levels of abstraction - Grady Booch Also true for AI -> MDE is the best tool for this evolution
  20. 20. AI is software, too! (and rather immature)
  21. 21. AI landscape Could B from DSLs PIM/PSM M2M M2T …
  22. 22. Modeling ML pipelines (data preparation is more challenging than the learning itself)
  23. 23. As expected, all players are moving in this direction • Key to get more users that will then become users of their underlying infrastructure Azure ML Studio Orange RapidMiner IBM SPSS Modeler Nvidia digits Knime
  24. 24. Model-Driven Bot Development: Xatkit https://github.com/xatkit-bot-platform Gwendal Daniel, Jordi Cabot, Laurent Deruelle, Mustapha Derras: Multi-platform Chatbot Modeling and Deployment with the Jarvis Framework. CAiSE 2019: 177-193
  25. 25. Let’s create a chatbot to help newcomers to write issues on Github! Alright! It’s just a set of questions & answers, this will be pretty simple! Narrator It wasn’t. Once upon a time
  26. 26. What went wrong? if(‘’ I have an issue’’) { return ‘’In which repository?’’ }
  27. 27. Chatbots are complex systems Conversation Logic Text Processing External Services Messaging Platforms Deployment Evolution Maintenance Tests
  28. 28. AI Chatbot landscape
  29. 29. MDD of (chat)bots with Xatkit • Raise the level of abstraction at what chatbots are defined – Focus on the core aspects of the chatbot • Conversation and user interactions • Action computations – Independent from specific implementation technologies • Automate the deployment and execution of the modeled chatbot over multiple platforms
  30. 30. Chatbot dev – Example: Bots for OSS Slack bot to help users open a well-described new issue on a GitHub project If the User Wants To Open Issue Reply « In which repository? » on Slack User Intent Action Parameters Platform Conversation step
  31. 31. Intent language Library example intent OpenNewIssue { inputs { ‘’I want to create an issue’’ ‘’Open an issue’’ } } intent SpecifyRepository { inputs { ‘’In repository MyRepo’’ } outContext Repository { name <- ‘’MyRepo’’ (@any) } }
  32. 32. Execution Language Import library Example Import platform Slack Import platform Github Listen to Slack on intent OpenNewIssue do Slack.reply(‘’Sure, I’ll help you to write your issue! Which repository is for?’’) on intent SpecifyRepository do Slack.reply(‘Great, I’ll open an issue related to repository {$Repository.name}.’’) [… a few intents later with all the info …] Github.openIssue({$Repository.name}, {$Issue.title}, {$Issue.content})
  33. 33. Platform Language Abstract platform Chat actions { PostMessage(message, channel) Reply(message) } } Platform Slack extends Chat Platform Github action { openIssue(repository, title, content) } }
  34. 34. Xatkit Framework Chatbot Designer Intent Recognition Providers (platform-specific) Platorm Package Intent Package Xatkit Modeling Language Chatbot User Instant Messaging Platforms Xatkit Runtime Execution Package uses uses Platform-independent chatbot definition External Services Deployment Configuration Platform Designer
  35. 35. How can we be friends: (2) AI for MDE
  36. 36. AI to simplify development
  37. 37. Smart Autocomplete
  38. 38. Smart Autocomplete https://ai.facebook.com/blog/aroma-ml-for- code-recommendation/
  39. 39. Also in MDE land.... Jordi Cabot, Robert Clarisó, Marco Brambilla, Sébastien Gérard: Cognifying Model-Driven Software Engineering. STAF Workshops 2017: 154-160
  40. 40. Mendix Assist
  41. 41. OutSystems.ai
  42. 42. Many other useful applications to explore Modeling bot as virtual assistant (kind of an “expert system”) Model inferencer to discover schema of unstructured data A code generator that mimicks a company programming style A real-time model reviewer ( “pair-modeling” ) A morphing modeling tool that adapts to the user profile (expertise, typical usage)
  43. 43. AI to skip modeling: An ML-based approach to learn model transformations Loli Burgueño, Jordi Cabot and Sebastien Gerard. An LSTM-Based Neural Network Architecture for Model Transformations
  44. 44. Model transformations chain Original model … CODE Software code1 refinementst n refinementth Model-to-model Transformation Model-to-text Transformation CODE CODE • Requires learning a new language (the MT Language) • Time consuming • Error prone
  45. 45. Let’s try to learn the MTs automatically Input Output Training Transforming ML Input OutputML Machine Learning Artificial Neural Networks Deep Networks Recurrent networks LSTM BPMN Petri nets BPMN Petri Net
  46. 46. MTs ≈ sequence-to-sequence arch • Combine two LSTM for better results • Avoids fixed size input and output constraints
  47. 47. Tree-to-Tree Encoder-decoder arquitecture InputTree EmbeddingLayer Encoder LSTM network OutputTree ExtractionLayer Decoder LSTM network AttentionLayer InputModel OutputModel
  48. 48. • Pre- and post-processing required to… • represent models as trees • reduce the size of the training dataset by using a canonical form • rename variables to avoid the “dictionary problem” InputModel (preprocessed) InputTree EmbeddingLayer Encoder LSTM network OutputTree ExtractionLayer OutputModel (non-postprocessed) Decoder LSTM network AttentionLayer InputModel OutputModel Preprocessing Postprocessing Complete picture ML is NOT a fast learner!
  49. 49. AI for model management: Model similarity with Graph Kernels Robert Clarisó, Jordi Cabot: Applying graph kernels to model-driven engineering problems. MASES@ASE 2018: 1-5
  50. 50. Model diversity for better testing
  51. 51. If I ask a solver for 25 solutions, I only get three REALLY different ones!
  52. 52. Graph-based ML for more diverse results
  53. 53. Feature-based methods • Graphs summarized as feature vectors • The choice of the features is key • E.g. of features: number of vertices, edges, avg/min/max degree… Easy to use BUT loss of precision
  54. 54. Kernel-based methods • Goal – Polynomial times – Capture relevant topological information • How – Compare graph structures: path, subtrees, cycles – Different Kernel methods. E.g. random walks Best Kernel depends on the problem!
  55. 55. Let’s revisit this problem Kernels to cluster the solutions and choose representative examples
  56. 56. The leader of a dept works in a different dept (error?) Might be missed by feature vector encoding
  57. 57. (MDE <-> AI) meta
  58. 58. A model- based bot used to build models
  59. 59. Also for BPMN models Joint work with Josep Carmona’s team (go to see From Process models to chatbots on Wed)
  60. 60. Smart modeling tools to generate smart apps
  61. 61. Open Challenges
  62. 62. All this is very fancy and fashionable BUT
  63. 63. Where is my data? Every few years, a new initiative to collect models in a repo pops up but in the end… Data augmentation techniques? (mutation, GANs,…)
  64. 64. • Size of the training dataset • Diversity in the training set • Computational limitations of ANNs – i.e., mathematical operations • Generalization problem – predicting output solutions for input models very different from the training distribution it has learnt from Limits of Neural Networks
  65. 65. Models Community
  66. 66. Modeling needs to adapt - AI is here to stay - Let’s see it as an opportunity - To showcase the benefits of modeling - To improve the modeling experience and broaden its user base
  67. 67. Models are not enough We need (smart) processing capabilities to get the most out of themhttps://modelia.eu/
  68. 68. Summary
  69. 69. Exciting times to be a modeler!!
  70. 70. Let’s work together jordi.cabot@ icrea.cat @softmodeling modeling- languages.com
  71. 71. Back-up slides
  72. 72. Model representation MODEL ASSOCOBJ c Class ATTS isAbstract name false family OBJ a Attribute ATTS multivalued name false surname OBJ d t Datatype ATTS name String at t c a ASSOC typ e a d t
  73. 73. Preliminary results • Correctness – Measured through the accuracy and validation loss
  74. 74. Preliminary results • Performance 1. How long does it take for the training phase to complete?
  75. 75. Preliminary results • Performance 1. How long does it take for the training phase to complete? 2. How long it takes to transform an input model when the network is trained?

Notas del editor

  • Thank you for the invitation.

    It’s an honour to be here.

    I’ll talk about the intersection between these two concepts and how they can help each other

    I’ll try to cover the state of the art but also to focused on some specific applications we’re working on in my team

  • Similar to many of you
  • We have a soft side
  • They do the work, I take care of the marketing
  • Before we talk about the relationship between modeling and AI, we should make sure we have a common understanding of these concepts
  • I’ll skip the introduction to MDE since you’re all experts on this here.
  • There is always a model and we all model, at least in our head, the real question is whether to make the models explícit

    And this is linked to a trade-off analysis of the cost of these models vs the benefits of having them explícit. As we’ll see, AI can reduce the cost and maximize these benefits
  • We typically use the word AI or even just ML as these are the most fashionable concepts. And we’ll use those in this talk.

    But I prefer the word cognification, taken from these book.
  • Todo tendrá la opción de funcionar con o sin cognificación.
  • More than determining the exact limits of each circle the point is make clear that not everything can be reduced to Deep learning
  • So we may even wonder whether there is a future for us
  • Relationship between humans and AI depending on the type of tasks depending on two dimensions: compassion/empathy and creativity/optimization

    Best results always in the category where both have some kind of coooperation
  • We need to have a better perspective of what AI is (and is not) and how we can use it as a valuable tool
  • In fact they are very Good Friends that can help each other a lot. I’ll spend the rest of the talk describing how they can help each ohter.
  • Plenty of complexity and heterogeneity.


    This is the typical scenario where modeling abstractions can help a lot.

    The AI landscape could beneffit from DSLs, PIM, transformations, ….

    We’re very Good at this. Huge opportunity for us to contribute to the AI world.
  • The
  • A way to facilitate the creation of ML models. The easier to use the tool, the more users they get for their infrastructure
  • Still, typicall rather low-level and not integrated with the rest of the company Information System.
  • Plenty of complexity and heterogeneity.


    This is the typical scenario where modeling abstractions can help a lot.

    The AI landscape could beneffit from DSLs, PIM, transformations, ….

    We’re very Good at this. Huge opportunity for us to contribute to the AI world.
  • We need to define the potential intentions of the users,

    The actions / executions to be done in response

    And the platform (and services
  • All of you old enough may have a feeling of deja vu
  • A lot of initiatives going on in the programming IDEs domain
  •  It shows a customary usage of InputStream in decoding bitmaps. Furthermore, this recommendation demonstrates a good practice to catch the potential IOException when opening the InputStream. If this exception occurs in runtime and is not caught, the app will crash immediately. A responsible engineer should extend the code using this recommendation and handle this exception properly.
  • Even powerpoint has an asssitant
  • Beyond an autocomplete similar to the Mendix Assist, they also offer another interesting type of suggestions for data models.
  • We all can imagine several potential applications

    And many of these ideas are not really new. It’s just that they are now posible thanks to better data and tools

    With Antoni we had already a Project 2011 on this topic
  • Typical MDD process
  • In the end we choose LSTM (Long short Term memory networks) since they are able to remember more context
    (RNN already remember due to the backpropagation but LSTM remember more long distance)

    When transforming models you need to have this capacity of remembering parts of the models you’ve seen and matched before
  • A typical sequence-to-sequence arch combines two LSTMs for better results especially regarding constraints on the input and output sizes.
  • The encoder transform the sequence into a fixed size numeric vector. The decoder reverses the process

  • We follow a variation that uses tree embeddings as this is closer to models
  • AI can also help in managing and sorting models
  • Which is clearly inefficient


    If we can somehow cluster the solutions and just take one of each type, we would get much more meaningful information!
  • And you may even need to define your own
  • Which is clearly inefficient
  • And you may even need to define your own
  • And you may even need to define your own
  • I haven’t yet seen this combination much. E.g. apps that include facial recognition components
  • More and more mixed. Following up on what we said before, we need lowcode tools to include ML component that help users include inteligent components in their apps
  • Possibilites are endless but only if we manage to fix some important challenges first.
  • More and more mixed. Following up on what we said before, we need lowcode tools to include ML component that help users include inteligent components in their apps
  • We should talk about the elephant in the room
  • There is no GitHub for models

    This makes any initiative related to ML difficult to implement with Good results.

    Also transfer learning could help here
  • But if we only focus on the techniques we’re missing the most important aspect: the people building AND using those models - > social aspects of AI
  • One way or the other, modeling needs to adapt to stay relevant
  • If we want to move MDE forward we need more than just keep improving modeling techniques
  • Need to understand a new community, difficulties in publishing…
  • We’re always looking for collaborations.

    So get involved in our research or stop complaining about useless research done in academia!!!!
  • The correctness of ANNs is studied through its accuracy and overfitting (being the latter measured through the validation loss). The accuracy should be as close as 1 as possible while the validation loss as close to 0 as possible.

    The accuracy is calculated comparing for each input model in the test dataset whether the output of the network corresponds with the expected output. If it does, the network was able to successfully predict the target model for the given input model.

    The accuracy grows and the loss decreases with the size of the dataset, i.e., the more input-output pairs we provide for training, the better our software learns and predicts (transforms). In this concrete case, with a dataset with 1000 models, the accuracy is 1 and the loss 0 (meaning that no overfitting was taking place), which means that the ANNs are perfectly trained and ready to use. Note that we show the size of the complete dataset but, we have split it using an 80% of the pairs for training, a 10% for validation and another 10% for testing.

×