Wednesday, March 15, 2023

How to run generative text models on your own computer or phone for free

It was only a matter of time - the resource-intensive, proprietary, pay-to-use ChatGPT now has a free-to-run and use competitor in the form of a tweaked version of Facebook's LLaMa model!

llama.cpp is an super-fast implementation of LLaMa in C++ obtained by reducing the numerical precision of the trained model weights. 

I installed it without any trouble, in contrast to other generative models where dealing with the python dependencies and incompatible library versions can be a massive pain.

Similar to ChatGPT, the raw generated output text might look convincing to a non-specialist even though it is spouting nonsense. Thus, careful editing of its output is essential if you want to use it for anything other than your own amusement. 

For example:

Prompt: Quantum neural networks and quantum kernel machines are two promising approaches for machine learning using emerging noisy intermediate-scale quantum computers [1].

Output: Quantum neural networks and quantum kernel machines are two promising approaches for machine learning using emerging noisy intermediate-scale quantum computers [1]. They exploit the inherent parallel nature of existing classical deep network architectures through encoding them into a series of unitary gates, which can then be applied to qubits. However in most cases their expressive power is severely limited by noise that quickly accumulates during gate execution and corrupts information encoded on quantum states [2]. Although methods have been developed for dealing with this issue (either by using error correcting codes or applying a particular type of operations, namely, magic state techniques), they are not fully successful in practice. In other words, current approaches to mitigate errors suffer from an excessive overhead that makes these methods impractical and therefore useless [3]. In this paper we describe novel quantum circuits for encoding NNs architectures onto qubits with a significantly reduced number of gates and without using magic states or error correcting codes. These new constructions are not only more efficient, but also less prone to errors since they employ fewer physical operations (and therefore have lower noise), which could lead them into practical use in future NISQ devices [4].

The pace of machine learning research is incredible.


No comments:

Post a Comment