I spent the weekend conducting a bit of experimentation with GPT-4, with a goal to better understand the limitations in regard to mathematical reasoning and the ability to adhere to strict output guidelines. I have some understanding of how tokenization works and the issues it causes with the model’s ability to count words specifically. However, I had consistent success with having GPT4 perform long multiplication in part due to the use of grouping and labeling, as seen here [ youtu.be/KqjNCuzNRH8 ], so I decided to approach the problem constricting word count on output similarly by labeling the model’s output. Specifically, the approach was to instruct each word to be wrapped and paired with a sequential number, its tag, (1- Like) (2- so). The goal was increased attention bias towards the # and recognition of each word as a whole, rather than the token.
After some trial and error via API chat completions, I’m receiving remarkably accurate output using this self-tag technique. What caught me completely off guard, however, was the output quality, which was seemingly improved in ways, yet adhered strictly to the constraints. One would expect the extra compute and interruption of natural language would potentially cause the opposite. I’m not sure what to make of this yet.
Here’s an example chat completion, an exact 300-word essay, as it happened. I’ll include the actual output with the tagging removed at the end of the post:
It appears GPT-4’s ability to accurately conform to a specified word count is absolutely possible when using a self-tagging approach to increase its attention ability. Additionally, the model’s ability to structure content as if it had foresight, especially in the context of a fixed word limit, suggests a level of sophistication beyond basic next-token prediction. What mechanisms within GPT-4 might facilitate this apparent planning? What other areas can be improved with this concept of having the model essential label its own data at the output level?
Does anyone know of any research papers on these topics? My aim is to explore these concepts with a larger data set and sample size; however, I need to address API cost to do so.
Full output below:
User: ‘Write me a 300 word essay on the ecology of the desert cactus’
"The desert cactus stands as a unique beacon of resilience in the harshest of environments. Its ecology is a complex web of interactions with various abiotic and biotic factors. Survival in the desert calls for exceptional adaptations, which cacti have in spades. Firstly, their thick skin reduces water loss. Significantly, they possess spines instead of leaves, minimizing the surface area for transpiration. The roots of desert cacti spread wide to capture sparse rainfall, while their stems store water for dry periods.
In terms of reproduction, the vibrant flowers attract pollinators, ensuring genetic diversity. Moreover, they offer shelter and sustenance to desert wildlife, thus playing a pivotal role in the desert ecosystem. Their presence assists in soil stability and prevents erosion by anchoring the sand.
Cacti are also a crucial component in the desert food web, serving as a resource for birds, insects, and mammals. Some species even rely on the cactus exclusively for water and nourishment during droughts. The relationship between cacti and desert inhabitants is symbiotic as some animals help in seed dispersal, thereby aiding cacti in propagation.
However, human activity and climate change are threatening these ecosystems. Habitat destruction, illegal collection, and the introduction of non-native species have the potential to disrupt the delicate balance. Desert cacti are adapted to survive extreme heat and aridity, but they are not invincible.
Conservation efforts must be enacted to protect these resilient plants and their roles within the ecosystem. Cacti epitomize the beauty and complexity of desert ecology, a testament to life’s perseverance. Even in adversity, they thrive and contribute to the biodiversity of their arid habitats. It is essential that we recognize and maintain the significance of desert cacti, not only for their intrinsic value but also for the survival of desert ecosystems and the myriad forms of life therein." (300 words)