Skip to main content
QUICK REVIEW

[论文解读] SmartChoices: Hybridizing Programming and Machine Learning

Victor Cărbune, Thierry Coppey|arXiv (Cornell University)|Oct 1, 2018
Reinforcement Learning in Robotics参考文献 26被引用 7
一句话总结

SmartChoices 引入了一种混合编程-机器学习范式,通过一个三调用 API 将机器学习直接嵌入代码,使开发人员能够仅通过极少的代码更改,用可学习模型替换经典算法中的启发式规则。该方法利用启发式初始化的强化学习模型,在二分查找、快速排序和缓存中提升了性能,结果优于纯启发式方法,同时保持了完全的开发人员控制和安全性。

ABSTRACT

We present SmartChoices, an approach to making machine learning (ML) a first class citizen in programming languages which we see as one way to lower the entrance cost to applying ML to problems in new domains. There is a growing divide in approaches to building systems: on the one hand, programming leverages human experts to define a system while on the other hand behavior is learned from data in machine learning. We propose to hybridize these two by providing a 3-call API which we expose through an object called SmartChoice. We describe the SmartChoices-interface, how it can be used in programming with minimal code changes, and demonstrate that it is an easy to use but still powerful tool by demonstrating improvements over not using ML at all on three algorithmic problems: binary search, QuickSort, and caches. In these three examples, we replace the commonly used heuristics with an ML model entirely encapsulated within a SmartChoice and thus requiring minimal code changes. As opposed to previous work applying ML to algorithmic problems, our proposed approach does not require to drop existing implementations but seamlessly integrates into the standard software development workflow and gives full control to the software developer over how ML methods are applied. Our implementation relies on standard Reinforcement Learning (RL) methods. To learn faster, we use the heuristic function, which they are replacing, as an initial function. We show how this initial function can be used to speed up and stabilize learning while providing a safety net that prevents performance to become substantially worse -- allowing for a safe deployment in critical applications in real life.

研究动机与目标

  • 通过使机器学习在编程语言中成为一等公民,弥合传统软件开发与机器学习之间的差距。
  • 通过允许开发人员在不重构现有系统或工作流的情况下集成机器学习,降低在新领域应用机器学习的门槛。
  • 提供一种安全、可控且高效的强化学习应用方式,用于算法问题,借助启发式初始化。
  • 证明机器学习可通过极少的代码更改和可测量的性能提升,增强经典算法(如二分查找、快速排序、缓存)的性能。

提出的方法

  • 提出 SmartChoice,作为编程语言中的一等对象,可观察上下文、预测值并接收反馈,从而替代传统启发式规则。
  • 公开一个三调用 API:observe() 用于收集上下文,predict() 用于获取模型输出,feedback() 用于提供性能信号。
  • 使用标准深度强化学习进行模型训练,将被替换的启发式函数作为初始策略,以加速并稳定学习过程。
  • 将启发式函数作为安全网,防止训练期间性能下降,确保在生产环境中的鲁棒性。
  • 通过将 SmartChoice 建模为对象、函数或变量,支持在面向对象、函数式或命令式语言中的集成。
  • 支持渐进式采用:现有代码结构和领域特定逻辑保持不变;仅需将启发式逻辑替换为可学习模型。

实验结果

研究问题

  • RQ1能否在保留开发人员控制的前提下,通过极少的代码更改将机器学习集成到经典算法中?
  • RQ2如何在不需完整机器学习流水线开发的情况下,将强化学习应用于算法问题?
  • RQ3启发式函数能否在现实系统中作为基于强化学习的模型训练的有效初始化和安全网?
  • RQ4机器学习在二分查找、快速排序和缓存等经典算法问题中,能在多大程度上提升性能?
  • RQ5是否可以设计一个统一且可重用的 API,抽象跨系统优化和用户建模等多样化领域中的机器学习集成?

主要发现

  • SmartChoices 在三个算法问题(二分查找、快速排序和缓存)中成功实现了对纯启发式方法的性能超越,证明了仅通过极少的代码更改即可获得可测量的性能提升。
  • 将原始启发式函数作为初始函数,显著加速并稳定了强化学习训练过程。
  • 启发式函数作为安全网,防止了性能下降,实现了关键应用中的安全部署。
  • 该方法使开发人员能够完全控制数据、反馈和推理过程,从而颠覆了传统的以模型为中心的机器学习范式。
  • 该框架具有可扩展性:相同的 SmartChoice API 可在面向对象、函数式和命令式编程范式中复用。
  • 该方法使开发人员能够在以往因复杂性和缺乏基础设施而难以应用机器学习的领域中引入机器学习,且无需构建完整的机器学习流水线。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。