Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Embracing Python, AI, and Heuristics: Optimal P...

Embracing Python, AI, and Heuristics: Optimal Paths for Impactful Software

This keynote was presented at EuroPython 2024 in Prague, Czech Republic.

https://ep2024.europython.eu/session/embracing-python-ai-and-heuristics-optimal-paths-for-impactful-software

Abstract
Today’s rapidly evolving software landscape requires agile and informed decision-making. This keynote will highlight the powerful combination of Python, Artificial Intelligence (AI), and heuristics for enabling dynamic decision-making processes.

We will explore the strengths of Python as a versatile language, the potential of AI for intelligent decision support, and the value of heuristics derived from real-world experience. By embracing this synergistic trio, developers can navigate complex challenges, adapt to changing requirements, and make decisions that drive successful software outcomes.

Through practical examples and insights, attendees will gain a deeper understanding of how to leverage Python, AI, and heuristics effectively, striking the right balance between technological innovation and tried-and-true techniques. Whether you’re a seasoned developer or just starting your journey, this keynote will equip you with the tools and mindset to embrace agility and make informed decisions that propel your software projects forward.

Carol Willing

July 10, 2024
Tweet

More Decks by Carol Willing

Other Decks in Technology

Transcript

  1. Carol Willing Python Core Developer Python Steering Council (three terms)

    Python Software Foundation Fellow Jupyter Core Developer 2017 ACM Software System Award Papermill Maintainer pyOpenSci Advisory Board Chan Zuckerberg Open Science Board Quansight Labs Board VP of Engineering, Noteable
  2. Developer decisions What should I learn? Which tool is best?

    How do I use this tool? When do I use this tool? 15 Dynamic world
  3. Paradigm Shifts 16 Change how we work Dynamic world Transistors

    and mainframes Personal Computers Worldwide Web Generative AI and LLMs Cellular service Time 2012-present 1989-1996 1970-1995 1980-2020 1950-2000 Enterprise Government Individuals Expect tension between stakeholders until a steady state is reached
  4. Paradigm shifts evolve over time. 18 Dynamic world Think in

    years, not months or days. https://www.mckinsey.com/capabilities/quantumblack/our-insights/the-state-of-ai
  5. Create a toolbox 22 Dynamic world Generated by ChatGPT 4o:

    make an image of a toolbox containing the words Python, AI, Heuristics Using cognitive science
  6. Strengths of Python Solid Foundation 24 Python 1. Readability 2.

    Extensive Standard Library 3. Large ecosystem 4. Cross-platform compatibility 5. Community support 6. Versatility 7. Rapid prototyping 8. Integrates with other languages 9. Typing fl exibility 10. Multidomain: web, science, data science, education, embedded
  7. Performance Step 1: Releases 25 Python • Use a recent

    Python or pypy • Performance has steadily improved. • 3.13 in beta • Experimental freethreading without the gil (global interpreter lock) • Experimental JIT compiler • Release date: Tuesday, 2024-10-01 https://docs.python.org/3.13/whatsnew/3.13.html Stay up to date Special thanks to our release managers. Thomas Wouters 3.13 Hugo van Kemenade 3.14 and 3.15
  8. Performance Step 2: Measure 26 Python • timeit or magic

    %timeit • cPro fi le (deterministic pro fi ler) • Pyinstrument (statistical pro fi ler) • py-spy (sampling pro fi ler) • pyperf (https://github.com/psf/pyperf) • GPU: CUDA, numba, cuPy Profile and Optimize
  9. Performance Pro fi le running processes with py-spy 27 Python

    py-spy Search fit (implicit/als.py:159) calculate_similar_artists (lastfm.py:79) fit (implicit/als.py:163) _get_similarity_score (implic.. _get_similarity_score (implicit/recommender_.. argpartition (numpy/core/fromnumeric.py:757) _wrapfunc (numpy/core/fromnumeric.py:51) calculate_similar_artists (lastfm.py:95) similar_items (implicit/recommender_base.py:203) <module> (lastfm.py:161) visualize with fl ame graphs https://docs.ray.io/en/latest/cluster/kubernetes/k8s-ecosystem/pyspy.html https://github.com/benfred/py-spy https://www.youtube.com/watch?v=p8s2fzqA07s Anthony Sottile, Sentry usage installation Step 3: Pro fi le processes
  10. Modernize web WASM • Pyodide • JupyterLite • PyScript •

    PyCafe • PySheets 29 Python https://www.willingconsulting.com/pysplashlive.html JupyterLite runs entirely in the browser.
  11. Modernize mobile iOS, Android 30 Python https://peps.python.org/pep-0730/ PEP 730 –

    Adding iOS as a supported platform PEP 738 – Adding Android as a supported platform https://peps.python.org/pep-0738/
  12. User Success Developed by and for humans • Developer experience

    • Packaging experience • PEPs: How to teach • Documentation • Accessibility 32 Python Lessons learned maintaining open source Python projects (Bernat Gabor) https://youtube.com/watch?v=rcSLOqwpJk8
  13. Recap 33 Python Strengths Performance Polyglot Mobile and Web Innovation

    User success Python provides a solid foundation.
  14. AI is a tool. AI is not a person. A

    person chooses an AI tool. An AI tool has limitations. Fit the tool to the job. Minimize the harm done by the tool. 38 AI ABCs
  15. LLMs Black box or not 39 AI https://youtu.be/jkrNMKz9pWU A Hackers

    Guide to Language Models by Jeremy Howard LLM https://github.com/fastai/lm-hackers https://fastai.github.io/lm-hackers/lm-hackers.html Input Output
  16. Transparent and Trusted Tension between people and pro fi ts

    40 AI Incentives Costs Privacy Security Ethical matrix https://youtu.be/Z267wxOYPms https://www.oxford-aiethics.ox.ac.uk/ https://www.oxford-aiethics.ox.ac.uk/lyceum-project-ai-ethics-aristotle-white-paper https://dl.acm.org/doi/full/10.1145/3544548.3581318
  17. Trust the tool Consider the source 41 AI Synthetic Lies:

    Understanding AI-Generated Misinformation and Evaluating Algorithmic and Human Solutions https://dl.acm.org/doi/full/10.1145/3544548.3581318 XAI: Explainable AI Explainability includes not only code, but also data, infrastructure, processes, and governance. Synthetic AI First major study of generated misinformation https://github.com/wangyongjie-ntu/Awesome-explainable-AI
  18. – Jeremy Howard Claudette removes the complexity and boilerplate and

    makes using AI much easier. 42 AI https://www.answer.ai/posts/2024-06-21-claudette.html https://claudette.answer.ai/
  19. – Jeremy Howard Claudette's literate notebook source shows a better

    way to write so ft ware -- a way that allows anyone to understand and contribute to a project. 43 AI https://youtu.be/p_8Zk6HUCV8?si=AxkVOBggTaNkQMwg
  20. Understanding is key "We all are data people." • Context

    • Use case • Limitations • Criticality • Access 44 AI https://youtu.be/GBycch2OSx8 Interview with Scott Hanselman
  21. Accelerating Science Decision support and idea generation 45 AI https://chanzuckerberg.com/blog/priscilla-chan-update-ai-biomedical-research/

    https://tech.chanzuckerberg.com/scitech/ Universal Sequence-Based Embeddings Universal embeddings of cells and organelles from microscope images Explore the molecular underpinnings of human health and disease
  22. Recap 46 Python ABCs Not a person Evolved over time

    Open source to closed commercial o ff erings Transparent and trusted Literate Understanding LLMs are tools with tradeo ff s. AI
  23. Heuristics 48 Heuristics • Real-world experience • Use when information

    is unknown, overwhelming, or random • Understandable • Pragmatic • Low friction to use
  24. Ten Software Development Heuristics Rules of Thumb 49 Heuristics 1.

    YAGNI (You Aren’t Gonna Need It) 2. Divide and Conquer: Break down complex problems 3. KISS (Keep It Simple, Superheroes): Avoid complexity 4. User-Centric Design: Focus on the end-user 5. Fail Fast: Detect errors early
  25. Ten Software Development Heuristics Rules of Thumb 50 Heuristics 6.

    Incremental development: feedback and adjustments 7. CI/CD: Catch errors early 8. DRY (Don't Repeat Yourself) 9. Code smells 10. Refactoring: Improve without changing behavior
  26. Problem-solving decisions SCAMPER 53 • Substitute • Combine • Adapt

    • Modify • Put to another use • Eliminate • Reverse https://www.designorate.com/a-guide-to-the-scamper-technique-for-creative-thinking/ Heuristics
  27. Learning 54 Cognitive Science Tips Python Code vs Pythonic Code

    Heather Crawford - PyTexas 2024 Experts recognize Beginners reason Heuristics The human mind works quite di ff erently than a computer. Brown, Neil C. C., Felienne F. J. Hermans, and Lauren E. Margulieux. “10 Things Software Developers Should Learn about Learning.” Communications of the ACM 67, no. 1 (January 2024): 78–87. https://doi.org/10.1145/3584859. https://www.youtube.com/watch?v=RdkhRfRizf0
  28. Recap 55 Python Rules of thumb Useful Easy to apply

    Real-world experience Heuristics save time when a problem is large in scope with lots of uncertainty Heuristics
  29. 56 Your toolbox 5 Python AI Heuristics Time saving tools

    Transparent and trusted tools Proven language and tools
  30. Create your toolbox Curate often • complex challenges • changing

    requirements • make decisions • be con fi dent • impact human outcomes 57 Generated by ChatGPT 4o: make an image of a toolbox containing the words Python, AI, Heuristics
  31. 58 Call to Action Python AI Heuristics Time saving tools

    Transparent and trusted tools Proven language and tools
  32. Impact your world 62 Python AI Heuristics Instead of imagining

    that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do. – Donald E. Knuth, Literate Programming (1984)
  33. 66 Brown, Neil C. C., Felienne F. J. Hermans, and

    Lauren E. Margulieux. “10 Things Software Developers Should Learn about Learning.” Communications of the ACM 67, no. 1 (January 2024): 78–87. https://doi.org/10.1145/3584859. Cai, Carrie J., and Philip J. Guo. “Software Developers Learning Machine Learning: Motivations, Hurdles, and Desires.” In 2019 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC), 25–34. Memphis, TN, USA: IEEE, 2019. https:// doi.org/10.1109/VLHCC.2019.8818751. Chakravorti, Bhaskar. “AI’s Trust Problem.” Harvard Business Review, May 3, 2024. https://hbr.org/2024/05/ais-trust-problem. Cogo, Filipe Roseiro, Xin Xia, and Ahmed E. Hassan. “Assessing the Alignment between the Information Needs of Developers and the Documentation of Programming Languages: A Case Study on Rust.” ACM Transactions on Software Engineering and Methodology 32, no. 2 (April 30, 2023): 1–48. https://doi.org/10.1145/3546945. Deters, Hannah, Jakob Droste, and Kurt Schneider. “A Means to What End? Evaluating the Explainability of Software Systems Using Goal-Oriented Heuristics.” In Proceedings of the 27th International Conference on Evaluation and Assessment in Software Engineering, 329–38. Oulu Finland: ACM, 2023. https://doi.org/10.1145/3593434.3593444. Ding, Jiepin, Mingsong Chen, Ting Wang, Junlong Zhou, Xin Fu, and Keqin Li. “A Survey of AI-Enabled Dynamic Manufacturing Scheduling: From Directed Heuristics to Autonomous Learning.” ACM Computing Surveys 55, no. 14s (December 31, 2023): 1–36. https://doi.org/10.1145/3590163. Donoho, David. “Data Science at the Singularity.” Harvard Data Science Review 6, no. 1 (January 31, 2024). https://doi.org/10.1162/99608f92.b91339ef. Dutta, Subhabrata, and Tanmoy Chakraborty. “Thus Spake ChatGPT.” Communications of the ACM 66, no. 12 (December 2023): 16–19. https://doi.org/10.1145/3616863. Eng, Richard Kenneth. “How to Measure Programming Language Complexity,” n.d., 4. Forrester, Jay W. “Digital Computers: Present and Future Trends.” In Papers and Discussions Presented at the Dec. 10-12, 1951, Joint AIEE-IRE Computer Conference: Review of Electronic Digital Computers on - AIEE-IRE ’51, 109–14. Philadelphia, Pennsylvania: ACM Press, 1951. https://doi.org/10.1145/1434770.1434789. Gonzalez, Eric. “Improvisational Research: How I Learned to Stop Worrying and Embrace Uncertainty.” XRDS: Crossroads, The ACM Magazine for Students 30, no. 3 (March 2024): 10–11. https://doi.org/10.1145/3652615. Gosline, Renée Richardson, Yunhao Zhang, Haiwen Li, Paul Daugherty, Arnab D. Chakraborty, Philippe Roussiere, and Patrick Connolly. “Nudge Users to Catch Generative AI Errors.” MIT Sloan Management Review, May 29, 2024. https://sloanreview.mit.edu/ article/nudge-users-to-catch-generative-ai-errors/. Guo, Philip J. “Six Opportunities for Scientists and Engineers to Learn Programming Using AI Tools Such as ChatGPT.” Computing in Science & Engineering 25, no. 3 (May 2023): 73–78. https://doi.org/10.1109/MCSE.2023.3308476. Guzdial, Mark, and Daniel Reed. “Securing the Future of Computer Science; Reconsidering Analog Computing.” Communications of the ACM 56, no. 4 (April 2013): 12–13. https://doi.org/10.1145/2436256.2436260. Hao, Karen. “Inside the Fight to Reclaim AI from Big Tech’s Control | MIT Technology Review.” Accessed June 24, 2021. https://www.technologyreview.com/2021/06/14/1026148/ai-big-tech-timnit-gebru-paper-ethics/. Hinsen, Konrad. “The Approximation Tower in Computational Science: Why Testing Scientific Software Is Difficult.” Computing in Science & Engineering 17, no. 4 (July 2015): 72–77. https://doi.org/10.1109/MCSE.2015.75. ———. “The Power to Create Chaos.” Computing in Science & Engineering 18, no. 4 (July 2016): 75–79. https://doi.org/10.1109/MCSE.2016.67. Hope, Tom, Doug Downey, Daniel S. Weld, Oren Etzioni, and Eric Horvitz. “A Computational Inflection for Scientific Discovery.” Communications of the ACM 66, no. 8 (August 2023): 62–73. https://doi.org/10.1145/3576896. Jacobs, Adam. “The Pathologies of Big Data.” Communications of the ACM 52, no. 8 (August 2009): 36–44. https://doi.org/10.1145/1536616.1536632. Kesari, Ganes. “Building a Data-Driven Culture: Three Mistakes to Avoid.” MIT Sloan Management Review, May 14, 2024. https://sloanreview.mit.edu/article/building-a-data-driven-culture-three-mistakes-to-avoid/.
  34. 67 Kirkpatrick, Keith. “The Carbon Footprint of Artificial Intelligence.” Communications

    of the ACM 66, no. 8 (August 2023): 17–19. https://doi.org/10.1145/3603746. Kohls, Christian. “Patterns for Innovation: 6 Patterns for Idea Implementation.” In Proceedings of the 24th European Conference on Pattern Languages of Programs, 1–8. Irsee Germany: ACM, 2019. https://doi.org/10.1145/3361149.3361156. Koreeda, Yuta, Terufumi Morishita, Osamu Imaichi, and Yasuhiro Sogawa. “LARCH: Large Language Model-Based Automatic Readme Creation with Heuristics.” In Proceedings of the 32nd ACM International Conference on Information and Knowledge Management, 5066–70. Birmingham United Kingdom: ACM, 2023. https://doi.org/10.1145/3583780.3614744. Kosch, Thomas, Jakob Karolus, Johannes Zagermann, Harald Reiterer, Albrecht Schmidt, and Paweł W. Woźniak. “A Survey on Measuring Cognitive Workload in Human-Computer Interaction.” ACM Computing Surveys 55, no. 13s (December 31, 2023): 1–39. https://doi.org/10.1145/3582272. Kugler, Logan. “What’s Old Is New Again.” Communications of the ACM 66, no. 11 (November 2023): 11–12. https://doi.org/10.1145/3624009. Lu, Yuwen, Tiffany Knearem, Shona Dutta, Jamie Blass, Clara Kliman-Silver, and Frank Bentley. “AI Is Not Enough: A Hybrid Technical Approach to AI Adoption in UI Linting With Heuristics.” In Extended Abstracts of the CHI Conference on Human Factors in Computing Systems, 1–7. Honolulu HI USA: ACM, 2024. https://doi.org/10.1145/3613905.3637135. Melbourne, Associate Professor Jenny Waycott and Dr Wafa Johal, University of. “The Women Putting the Intelligence in Artificial Intelligence.” Pursuit, March 7, 2023. https://pursuit.unimelb.edu.au/articles/the-women-putting-the-intelligence-in-artificial- intelligence. Melbourne, Dr Mor Vered and Associate Professor Tim Miller, University of. “What Were You Thinking?” Pursuit, August 23, 2018. https://pursuit.unimelb.edu.au/articles/what-were-you-thinking. Nassif, Mathieu, and Martin P. Robillard. “A Field Study of Developer Documentation Format.” In Extended Abstracts of the 2023 CHI Conference on Human Factors in Computing Systems, 1–7. Hamburg Germany: ACM, 2023. https://doi.org/ 10.1145/3544549.3585767. Norman, Donald A. “Twelve Issues for Cognitive Science.” Cognitive Science 4, no. 1 (1980): 1–32. https://doi.org/10.1207/s15516709cog0401_1. Perkel, Jeffrey M. “Ten Computer Codes That Transformed Science.” Nature 589, no. 7842 (January 20, 2021): 344–48. https://doi.org/10.1038/d41586-021-00075-2. Potter, Hannah, Ardi Madadi, René Just, and Cyrus Omar. “Contextualized Programming Language Documentation.” In Proceedings of the 2022 ACM SIGPLAN International Symposium on New Ideas, New Paradigms, and Reflections on Programming and Software, 1–15. Auckland New Zealand: ACM, 2022. https://doi.org/10.1145/3563835.3567654. Quinn, Clark. “The Cognitive Science Behind Learning.” Chief Learning Officer - CLO Media (blog), December 23, 2016. https://www.chieflearningofficer.com/2016/12/23/cognitive-science-behind-learning/. Savage, Neil. “Revamping Python for an AI World.” Communications of the ACM 66, no. 12 (December 2023): 13–14. https://doi.org/10.1145/3624987. Sochat, Vanessa. “The 10 Best Practices for Remote Software Engineering.” Communications of the ACM 64, no. 5 (May 2021): 32–36. https://doi.org/10.1145/3459613. Stigliani, Kimberly D. Elsbach and Ileana. “Evaluating New Technology? You’re More Biased Than You May Realize.” MIT Sloan Management Review, September 23, 2020. https://sloanreview.mit.edu/article/evaluating-new-technology-youre-more-biased-than-you- may-realize/. Teng, Shang-Hua. “‘Intelligent Heuristics Are the Future of Computing.’” ACM Transactions on Intelligent Systems and Technology 14, no. 6 (December 31, 2023): 1–39. https://doi.org/10.1145/3627708. Tshukudu, Ethel, and Quintin Cutts. “Understanding Conceptual Transfer for Students Learning New Programming Languages.” In Proceedings of the 2020 ACM Conference on International Computing Education Research, 227–37. Virtual Event New Zealand: ACM, 2020. https://doi.org/10.1145/3372782.3406270. Writer, AIT Staff. “Explainable AI: 5 Popular Frameworks in Python.” AiThority (blog), February 14, 2023. https://aithority.com/technology/explainable-ai-5-popular-frameworks-in-python-to-explain-your-models/. Ziegler, Albert, Eirini Kalliamvakou, X. Alice Li, Andrew Rice, Devon Rifkin, Shawn Simister, Ganesh Sittampalam, and Edward Aftandilian. “Measuring GitHub Copilot’s Impact on Productivity.” Communications of the ACM 67, no. 3 (March 2024): 54–63. https:// doi.org/10.1145/3633453.
  35. EuroPython July 10, 2024 Embracing Python, AI, and Heuristics Optimal

    Path to Impactful Software 68 Carol Willing