2 min readfrom Machine Learning

What coding practices are you adopting for development today? [D]

Our take

Many teams face the challenge of repetitive boilerplate code when developing new AI models. One developer recently shared their journey, moving from templating to shared libraries and now experimenting with Genie code generation to reduce project setup time from three days to under one. The core question remains: how to balance rapid development with long-term maintainability, avoiding the pitfalls of both fully custom solutions and overly rigid frameworks? This exploration mirrors concerns raised in "Estimating from No Data," highlighting the complexities of building robust systems.

The ongoing struggle to balance code reusability and flexibility in machine learning development is brilliantly articulated in this recent Reddit post. The author’s journey—from cookiecutter templates to shared libraries and now experimentation with Genie code generation—resonates with anyone who’s wrestled with the repetitive nature of setting up new models. The core issue highlighted is the inherent tension between creating a standardized, efficient starting point and the inevitable need to diverge from that standard as projects evolve. This mirrors a broader challenge across software engineering; the pursuit of DRY (Don't Repeat Yourself) principles often clashes with the reality of unique project requirements. It’s a familiar frustration, and the author’s candid assessment of each approach—the template’s decay, the library's glue code complexities, and Genie’s hallucination tendencies—provides valuable insights for others navigating this same landscape. Relatedly, the challenges of data validation and model scoring are also central to many machine learning endeavors, as highlighted in "[Rejected at EMNLP with decent scores. What can be done next? [D]" which addresses the difficulties of achieving satisfactory results despite seemingly good metrics.

The question posed at the end – "should we even write code?" – is provocative, though perhaps hyperbolic. The suggestion that a purely config-driven approach might be preferable, while initially appealing, inevitably leads to limitations when dealing with non-standard requirements. The author correctly identifies the pitfalls of both extremes: a rigid framework that stifles innovation and writing everything from scratch, which negates the benefits of reusability. A potential middle ground, as the author alludes to, lies in the creation of “opinionated frameworks” that provide a solid foundation while allowing for customization and extension. These frameworks should be designed with modularity and extensibility in mind, enabling developers to tailor them to specific project needs without fundamentally rewriting the underlying code. This idea connects to the broader discussion around deriving continuous scores from categories, a concept explored in "[Estimating from No Data: Deriving a Continuous Score from Categories]" where low-capacity networks are used to acquire fine-grained scoring—demonstrating how leveraging existing structures can produce sophisticated results.

The current trend toward code generation tools like Genie is undoubtedly a step in the right direction. By automating the creation of boilerplate code and configuration parsing, these tools can significantly reduce project setup time. However, as the author’s experience demonstrates, they are not a panacea. The challenge lies in finding the right balance between automation and control, ensuring that the generated code remains maintainable and adaptable. The key isn’t to eliminate coding entirely, but rather to shift the focus from repetitive tasks to higher-level problem-solving. This necessitates a move towards more declarative approaches, where developers specify *what* they want to achieve rather than *how* to achieve it. Tools that can translate these high-level specifications into executable code—while incorporating best practices and ensuring consistency—will be increasingly valuable in the future. The Oura lawsuit, detailed in “[Oura faces lawsuit accusing it of misleading consumers about sleep-tracking accuracy]”, also serves as a reminder of the importance of robust and reliable code, particularly when dealing with sensitive data and user expectations.

Ultimately, the conversation sparked by this Reddit post highlights a crucial evolution in the machine learning development lifecycle. It’s no longer sufficient to simply write code; we need to engineer systems that write code *for* us, intelligently and efficiently. The future likely involves a hybrid approach, combining the power of code generation tools with the flexibility of handcrafted code, all underpinned by well-designed, extensible frameworks. The critical question moving forward is not whether we should write code, but *how* we should write code, and how we can leverage technology to augment our capabilities and accelerate the pace of innovation. How will the rise of large language models further reshape this landscape, and will they ultimately be able to bridge the gap between declarative specifications and executable code in a truly seamless and reliable way?

I have been reflecting on this while working on a project recently. Every time we start a new model, we rewrite roughly same scaffolding, data validation checks, feature transformation logic ; all of this is nealy 80 percent identical to last project

I tired templating with cookiecutter style project generators. Initially it was okay, but it drifted from reality since noone wants to maintain a template repo. So tired a shared library approach, it helped and was much better. But weiting glue code to wite everything is still bug prone

Now i am experimenting with genie code to generate the boilerplate, the repetitive code, config parsing etc. it is decent for that part, though it starts hallucinating if columns increase say lot more than 40-50. It is not silver bullet, but it is cutting down the project setup time from 3 days to less than 1 day

So the deep question i am having now is, should we even write code? The config driven approach seems to be good, but eventually we are bound to suffer in a few months time when we start needing something non standard. Is there a middle ground, writing everything from scratch - the opinionated framework that becomes prison. How have you guys been developing? What are you adopting?

submitted by /u/Wrong_City2251
[link] [comments]

Read on the original site

Open the publisher's page for the full experience

View original article