Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Software Modeling and Artificial Intelligence: friends or foes?

644 views

Published on

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)

Published in: Software
  • Be the first to comment

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?

×