"I have recently learned that the magma produced at subduction zones
comes from the partial melting of the mantle above the subducting
plate and that very little comes from the plate itself."
It would be interesting if you could provide a source for this claim, as it is still unclear (Guo et al., 2022).
The island arcs and volcanic arcs are far from the mid-ocean ridge, and the plate that subducts has had time to accumulate a large stack of sediments. This source from the University of Dallas suggests that when the plate subducts, the melting of the oceanic crust with sediments becomes one of the sources of calc-alkaline and alkaline magmas that crystallize on the surface as felsic rocks. However, the volcanologist @Jean-Marie Prival doubts this assertion is true (see comments moved to chat).
Some studies suggest that andesites come from a mantle source and not the slab:
The sum of stratigraphic, geochemical, and isotopic evidence on
Agrigan supports the derivation of calc-alkaline andesite by the
removal of about 75% solids from a high-alumina basalt accompanied by
a process of K and Rb enrichment, such as volatile-transfer.
Considerations of 87Sr/86Sr, 143Nd/144Nd, and 3He/4He isotopic data
indicate that the source region of these parental liquids lies in the mantle, not subducted crust. (Stern, R.J., 1979).
What is certain is that the sediments of the subducted plate are hydrated. When the subducted plate melts, the magma is enriched in H2O due to dehydration of the slab, contributing to the explosive eruptions that form stratovolcanoes in both island arcs and volcanic arcs.
H2O also affects the magma differentiation:
Subduction zones (arcs and back-arcs) are major sites for elemental cycling via slab dehydration and subsequent mantle metasomatism and melting; many models have been suggested by researchers to explain these processes. However, the influence of the overriding lithosphere, especially the lower crust, on the generation of back-arc magmas during the early spreading stage remains largely unknown (Guo,K. et al, 2022).
You also wrote:
"This means that mid-ocean ridges, hot spots, and subduction zones all derive their magma directly from the mantle, yet they somehow produce magmas of differing compositions."
Both hot spots and mid-ocean ridges produce basaltic magmas derived from the mantle. It is still debated whether the composition of the slab in subduction zones affects the magma that generates the resulting felsic rocks. It might affect them residually. What is certain is that "somehow" refers to the subducted slab, and more specifically, the H2O accumulated in the sediments that alters the mantle magma differentiation.
A final consideration is that the temperature of the mantle varies greatly, from 1000°C near its boundary with the crust to 3700°C near its boundary with the core (source). This raises the question of whether this temperature is enough to melt sediments.
- The melting point of radiolaria SiO2 shells is 1.710 °C. The source of the Si enrichment can hardly be the sediments of the slag.
- This paper sugest some CaCO3 shells are preserved even the trench is under the Carbonate Compensation Depth. They migth enrich the magma in Ca, as CaCO3 melting point is 825ºC.
- Sedimentary clays have a melting point between 1250 °C to 1350 °C. They may enrich the magma in elements as Al or K.
-Eichelberger, J.C. Andesites in island arcs and continental margins: Relationship to crustal evolution. Bull Volcanol 41, 480–500 (1978). https://doi.org/10.1007/BF02597382
-Stern, R.J. On the origin of andesite in the northern Mariana Island Arc: Implications from Agrigan. Contr. Mineral. and Petrol. 68, 207–219 (1979). https://doi.org/10.1007/BF00371901
-Kun Guo, Xiaoyuan Wang, Shuai Chen, Luning Shang, Bingquan Liu, Xia Zhang, Zhiqing Lai (2022): "The delamination of lower crust in continental back-arc basin: Evidence from Sr isotope and elemental compositions of plagioclase and clinopyroxene in andesites from Kueishantao, north of Taiwan, China," Lithos, Volumes 416–417, ISSN 0024-4937, https://doi.org/10.1016/j.lithos.2022.106653.